0% found this document useful (0 votes)
448 views

Unit2: Answer: We Cannot Create Object For Anonymous Class

This document contains questions from 6 units that cover various Java concepts: Unit 1 focuses on Java features, command line arguments, loops, the JVM, type casting vs conversion. Unit 2 covers final keyword, access specifiers, objects, abstract classes and methods, overriding, and static. Unit 3 discusses interfaces and inheritance, exception handling keywords and examples, packages, exceptions, class vs interface, packages, finally block, throw vs throws keywords, and multiple inheritance. Unit 4 is about multithreading - stopping threads, advantages, achieving multithreading, priorities, communication, predefined threading class example, stopping threads, sleep method example. Unit 5 covers applet attributes, event handling, types of

Uploaded by

raj bhanot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
448 views

Unit2: Answer: We Cannot Create Object For Anonymous Class

This document contains questions from 6 units that cover various Java concepts: Unit 1 focuses on Java features, command line arguments, loops, the JVM, type casting vs conversion. Unit 2 covers final keyword, access specifiers, objects, abstract classes and methods, overriding, and static. Unit 3 discusses interfaces and inheritance, exception handling keywords and examples, packages, exceptions, class vs interface, packages, finally block, throw vs throws keywords, and multiple inheritance. Unit 4 is about multithreading - stopping threads, advantages, achieving multithreading, priorities, communication, predefined threading class example, stopping threads, sleep method example. Unit 5 covers applet attributes, event handling, types of

Uploaded by

raj bhanot
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

UNIT 1

1. Describe the different features of Java


2. Explain Command Line arguments with an example
3. How many times this loop will execute? Also write the value of m and n at end of loop. int
m=10; Int n=7; while(m%n>0) { m+=1; n+=2; }
4. Explain the concept of JVM in java and also how the program source code is converted into
machine code?
5. Difference between type casting and type conversion with example
6. How many times the loop will execute and write the output of this program int m=1; do {
m+=2; System.out.println(m); } while(m<10)

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.

2. Explain the important keywords used in exception handling with an example?

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:

1. Explain the different attributes of applet tag?


2. Explain the concept of event handling mechanism in applet? Explain some key events
in event handling mechanism?
3. What are the two types of applets? Differentiate between them.
4. What is applet? Describe the complete life cycle of an applet along with the methods
involved at the various stages.
5. What are the steps involved in executing an applet on command prompt?
6. What are the packages to be included in the class file of an applet? What are the
necessary functions to be used in the program?
7. Write a difference between an applet and a java application. Create a java application
and an applet to display the sum of two numbers on the screen.
8. Create a simple applet to display the string “Hello Java” using command prompt.

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.

You might also like