ST.
ANN’S COLLEGE OF ENGINEERING &TECHNOLOGY :: CHIRALA
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ASSIGNMENT QUESTIONS
Subject : OOP THROUGH JAVA Year/Sem: II B.Tech – I Sem
Academic Year: 2025-26 Regulation : R-23
UNIT-1 :
1. a) What are the different primitive data types in java? Give their sizes in bits. How they
are different from reference data types?
b) How to use break and continue statements in java?
2. a)Write a java program to illustrate the usage of conditional statements and looping
statements.
b) Write a java program that inputs an integer, ‘n’ from the command line and displays
the string “1+2+3+…+n=sum” and also compute the sum.
3. a) Write the importance of command line arguments. Write a Java program which
accepts the input from keyboard to display Fibonacci series.
b) Explain various Operators in Java with examples.
UNIT-2 :
1. What is an Object? How to allocate memory for objects? How to assign the values to
the variables in the class during the time of creation of an object to that class? Explain
with an example.
2. What is the difference between ‘static’ and ‘non-static’ methods in JAVA? ) Describe
the usage of static members and nesting members with suitable example programs in
java.
3. a) What is a Constructor? What is the main purpose of Constructors? How to invoke a
constructor in JAVA?
b) Write a java program to illustrate the Methods by passing arguments by Value and
passing arguments by reference.
UNIT-3 :
1. a) Explain about class Array and its methods. How can we implement dynamic array
with Vector?
b) Write a java program to illustrate various Vector operations.
2. a) List the types of Inheritances in Java. Discuss briefly about Access Control in
inheritance.
b) What is method overriding? Illustrate the concept of method overriding with an
example.
3. a) What is interface? Write briefly about types of interfaces. How does it supports
multiple inheritance in java?
b) Write two Java Programs to illustrate the use of default methods and static methods
in interfaces.
UNIT-4 :
1. a) How to create user defined packages and import them to java application program.
Illustrate with simple example.
b) What is the significance of the CLASSPATH environment variable in creating or
using a package?
2. a) Give the syntax of exception handling and also handle exception occurred during the
execution of divide by zero
b) What is the importance of Exception Handling in Java? Define and distinguish
between checked and unchecked exceptions.
3. a) What is the difference between finally and finalize in Java. Illustrate with example
b) Write about throw and throws keywords. Illustrate an example to rethrow a caught
exception.
.
UNIT-5 :
1. a) Explain about StringBuffer class with example program?
b) What are the different ways to create Threads? Explain with example program.
2. a) How Thread synchronization plays an important role resource sharing? Explain.
b) How Producer-Consumer problem can be addressed in multithreading? Explain with
example Program.
3. a) Explain about Establishing JDBC Database Connections to mysql database with
example program?
b) Write a JDBC program to search for an attribute in a table and display the entire
tuple to the user. For example, display all the details of the student given his/her roll
number.