Unit2: Answer: We Cannot Create Object For Anonymous Class
Unit2: Answer: We Cannot Create Object For Anonymous Class
UNIT2
1. Explain final keyword with example with class, method and variable?
2. Difference between friendly and protected access specifier >
3. Explain the concept of object? Why we create object for a class? Is there any Class whose
object cannot be created? If yes name them
Answer: We cannot create object for anonymous class.
4. Explain the concept of abstract in java in context to class and method?
5. Explain concept of Overriding in java
Explain static keyword? What do you mean by static members of class? Why main class is
defined Static?
UNIT 3:
1. "Interfaces in java implements multiple inheritance". Explain with the help of programs the
inheritance and implementation of an interface.
3. Demonstrate the use of packages i.e. Package definition and its use in java.?
4. What is exception? Explain the syntax of exception handling code ?also give example
5. differentiate between class and interface?
6. what are packages? how we can create packages?
7. what is finally block? When and how it can be used? Give a suitable example?
8. Differentiate between throw and throws keyword?
9. how multiple inheritance can be done in java explain with help of example?
UNIT 4:
1. Explain the two ways by which you can stop the thread.
2. What is multithreading? What are advantages of multithreading? How multithreading
can be achieved in java. Demonstrate this with the help of diagram.
3. How we can set priorities for thread?
4. Explain the methods for inter thread communication?
5. Which class is predefined by java to implement multithreading? Demonstrate with an
example to implement the concept of multithreading with that class?
6. What are the various methods to stop or pause the thread’s execution? Define each.
7. Give an example for how to use sleep() method in multithreading.
8. What is multithreading? How can we implement it in java? Give an example of both
the methods.
9. What are the various methods associated with the phases of a thread?
10. Describe the complete life cycle of a thread.
UNIT 5:
UNIT 6:
1. What do you mean by JDBC? Explain JDBC architecture and its components? [10]
a. What are different types of JDBC drivers? [5]
b. On what factors the performance of JDBC driver depends? [5]
2. Explain the different components of JDBC product?
3. Write the steps for java database connectivity.
4. Write a java code for insertion into the database
5. Write a java code for updation of data in database.
6. Write a java code for retrieving data from database.