Java Programming Question Bank PDF
Java Programming Question Bank PDF
in JNTU World
ld
or
W
TU
ld
UNIT – II
1 Define Inheritance? Understand 3
2 List types of inheritances in java? Understand 3
3 Write Member access rules Remember 3
4 Write Uses of ‘Super’ keyword Understand 3
or
5 Write using ‘final’ keyword with inheritance Understand 2
6 Write about Object class Understand 8
7 Define abstract classes? Understand 4
8 Define polymorphism? Understand 2
9 Define dynamic binding? Understand 3
10 Define method overriding? Understand 5
11
W
Difference between interfaces vs. Abstract classes Understand 5
12 Define interface? Understand 5
13 Define inner classes? Understand 5
14 Define static inner classes? Understand 2
15 Define a package? Understand 8
16 Write creating, importing packages? Understand 4
17 Define abstract methods? Understand 2
TU
ld
20 Write thread class implements Runnable interface Understand 10
UNIT – IV
1 Define collections? Understand 11
2 Define Java collection Frame work. Understand 11
3 Define Array List with syntax Understand 11
or
4 Define Vector with syntax. Understand 11
5 Define hash table with syntax. Understand 2
6 Define stack with syntax. Understand 8
7 Define enumeration with syntax. Understand 4
8 Write Iterator. Understand 2
9 Write the function of stringTokenizer. Understand 3
10
W
Define random class. Understand 11
11 Define Scanner class. Understand 11
12 Define Calendar class. Understand 2
13 Define Properties class Understand 8
14 Define Stream? Understand 4
15 Define byte stream? Understand 2
16 Define character stream? Understand 3
TU
ld
19 Write applet life cycle Understand 3
20 Describe applet security issues? Understand 9
or
S. No Question Blooms Course
Taxonomy Level Outcome
UNIT – I
1 Describe the characteristics of object oriented programming concepts? Understand 2
2 Describe the features (buzzwords) of Java Programming language? Understand 8
3 Write the Differences between Java and C++. Understand 4
4 Write Java is a pure object oriented programming language Understand 2
5
W
Distinguish between applications and applets in Java? Understand 3
6 Write about this reference. Understand 1
7 Write about the method overloading with an example. Understand 1
8 Write about the constructor overloading with an example. Understand 2
9 Write the concept of arrays with an example. Understand 8
10 Write about string class with an example. Understand 4
11 Write about the console input and output with an example. Apply 2
TU
UNIT – II
ld
10 Define interface? Write with an example? Knowledge 8
or
13 Write how packages are accessed Understand 3
14 Write extending interfaces with an example Understand 12
15 Define interface? Write Differences between classes and interfaces? Knowledge 2
16 Write final classes , methods with an example Understand 8
17 Write inheritance with an example Understand 4
18 Write how to prevent inheritance Understand 2
19
W
Write Member access rules with an example Understand 3
20 Write working procedure of CLASSPATH Understand 3
UNIT - III
1 Write about exception handling mechanisms Understand 2
2 Write try, catch , and finally with an example Understand 8
3 Define throw keyword? Write with an example Understand 4
4 Define throws keyword? Write with an example Understand 2
TU
ld
17 Write JDBC with an example. Understand 11
18 Write different types of JDBC drivers with diagrams. Understand 11
19 Write JDBC example for querying the database and processing the Apply 11
results.
20 Write JDBC example for updating data. Apply 11
or
UNIT – V
1 Write in detail about hierarchy for swing? Understand 8
2 Write in detail about hierarchy for awt? Understand 2
3 Write in detail about Layout management? Understand 8
4 Write a program for handling a button clicks? Understand 4
5 Write a program for handling mouse events? Understand 2
6
W
Write in detail about Events, Event sources and Event classes Apply 3
7 Write in detail about Event sources and Listeners Apply 8
8 Write program for simple applet? Apply 8
9 Write a program for passing parameters to applet? Apply 8
10 Write a program to C a factorial of a number using swing Apply 8
components?
11 Write a program to C a factorial of a number using awt components? Apply 8
TU
ld
System.out.println (“%d%d%d”, i, j, k);
continue;
}
}
}
Predict the output of the above code.
4 Explain the following code whether it is legal in Java? Is it an example
or
of method overloading or overriding?
public String getDescription(Object obj)
{
return obj.toString;
}
public String getDescription(String obj)
{ Understand 1
}
return obj;
W
and
public void getDescription(String obj)
{
return obj;
}
5 Analyze the following program and find the output of the program? Analyze 1
public class CounterAtomic
TU
{
private AtomicLong counter = new AtomicLong();
return counter.get();
}
}
UNIT - II
1 Write the java program to print the Armstrong number using method Understand 1
overriding?
2 Explain the following code legal in Java? Understand 1
class OuterClass
{
private int privInt = 10;
public void createInnerClass()
{
ld
}
}
}
public static void main(String[] args)
{
//create instance of outer class first:
or
OuterClass outClass = new OuterClass();
OuterClass.InnerClass inner = outClass.new InnerClass();
inner.accessOuter();
}
3 Analyze the following program and find the output of the program? Analyze 1
class A
{
//Members and methods declarations.
}
W
class B extends A {
//Members and methods from A are
inherited.
//Members and methods declarations of B.
}
TU
class A {
public A() {
System.out.println("New A");
}
}
class B extends A {
public B() {
super();
System.out.println("New B");
JN
}
}
4 Illustrate the output of the following program? Apply 1
interface MyInterface
{
public void method1();
public void method2();
}
class XYZ implements MyInterface
{
public void method1()
{
ld
obj. method1();
}
}
5 Describe how do we set the path for class which is present in another Knowledge 5
class?
UNIT - III
or
1 Explain the output of the following program? Understand 1
import java.util.Scanner;
class Division
{
public static void main(String[] args)
{
int a, b, result;
Scanner input = new Scanner(System.in);
W
System.out.println("Input two integers");
a = input.nextInt();
b = input.nextInt();
result = a / b;
System.out.println("Result = " + result);
}
}
2 Write a java program to book the online cinema ticket by using thread Knowledge 1
synchronization?
TU
{
for (int c = 1; c <= 5; c++)
{
System.out.println(languages[c]);
}
}
catch (Exception e)
{
System.out.println(e);
}
}
}
ld
{
System.out.println(e);
}
finally
{
System.out.println("finally block will execute always.");
or
}
}
}
Predict the output of the following code?
UNIT – IV
1 Describe fastest type of JDBC driver? Remember 2
2 Analyze the following program and find the output of the program? Apply 2
public class Test
{
W
public static void main(String[] args)
{
System.out.println(Math.min(Double.MIN_VALUE, 0.0d));
}
}
3 Analyze the following program and find the output of the program? Apply 4
public class Test
TU
{
public static void main(String[] args) throws Exception
{
char[] chars = new char[] {'\u0097'};
String str = new String(chars);
byte[] bytes = str.getBytes();
System.out.println(Arrays.toString(bytes));
}
}
4 Compare the output before adding and after adding? Remember 8
JN
import java.util.*;
ld
UNIT - V
1 Predict the output using below code and what happens if below code is Understand 9
not used in GUI programs?
public void windowClosing(WindowEvent e)
{
dispose();
or
System.exit(0);
}
2 Describe which containers use a border Layout as their default layout? Remember 8
3 Compare Java applet and a Java application? Remember 9
4 Explain the output of the following program? Understand 9
import java.applet.*;
import java.awt.*;
W
public class Main extends Applet
{
public void paint(Graphics g)
{
g.drawString("Welcome in Java Applet.",40,20);
}
}
<HTML>
TU
<HEAD>
</HEAD>
<BODY>
<div >
<APPLET CODE="Main.class" WIDTH="800" HEIGHT="500">
</APPLET>
</div>
</BODY>
</HTML>
5 Explain the usage of the following code? Understand 3
JN
ld
or
W
TU
JN