OOP

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

 Explain with a neat diagram the architecture of JVM.

 Write a program to print second smallest element in an array of 10 elements.


 What are the basic components of OOPS? List out all the features of Java.
 Explain the concept of “Jagged Array” with a suitable example.
 What is an exception? Discuss the usage of try-catch block with a proper example.
 Explain all the usages of super keyword in the inheritance with an example.
 Differentiate between throw and throws keywords with a suitable example on each.
 Explain dynamic method dispatch with a suitable example.
 What is synchronization? Explain the role synchronized method with a suitable example.
 Write a Java program to illustrate method overloading to calculate area of square, rectangle and
circle.
 Differentiate among sleep (), join (), and yield () methods with examples of each.
 Illustrate nested try block. Explain with suitable example by using exception classes
ArithmeticException and ArrayIndexOutOfBoundsException.
 Differentiate between String and StringBuffer class. Write a program to test whether a string is
palindrome or not.
 Explain the basic characteristics of object-oriented programming. Write a program to read a number
using a command line argument and check whether it is even or odd.
 Write a java program to print all the prime numbers between 100 and 200.
 Differentiate between for loop and for each loop. Write a program to arrange elements of an array
in descending order using the bubble sort technique.
 Write a java program to read a square matrix of n x n order (Read value of n by using Scanner class)
and print the following:
1. Sum of all the elements row-wise
2. Sum of diagonal elements
 List out all the differences between “abstract class” and “interface”. Explain the role of marker
interface.
 Demonstrate the following with examples on each.
1. Dynamic method dispatch
2. Constructor overloading
 List out all the inheritances supported by java. Explain with an example how multiple inheritance is
achieved in java.
 Explain all the keywords used in the exception handling mechanism. Write a java program to
demonstrate how arithmetic exception can be handled.
 What is serialization? Explain the role of “transient” keyword in serialization with an example.
 Explain the following with an example of each:
1. synchronized method
2. synchronized block
 Explain the life cycle of a thread. Write a program to illustrate the usage of join() method.
 What do you mean by Wrapper class. Describe Autoboxing and Unboxing with suitable example.
 Explain the following with an example:
i) this ii) super iii) final
 Write an interface called Playable, with a method void play();
 Let this interface be placed in a package called music. Write a class called Veena which implements
Playable interface. Let this class be placed in a package music.string. Write a class called Saxophone
which implements Playable interface. Let this class be placed in a package music.wind
Write another class Test in a package called live. Then,
a. Create an instance of Veena and call play() method
b. Create an instance of Saxophone and call play() method

 Explain all the characteristics of Java. Write a program to calculate the factorial of a number.
 Write a java program to read a number and test whether it is Armstrong or not.
 Differentiate between for loop and for each loop. Write a program to illustrate an array of objects.
 Write a java program to read two matrices of m x n and p x q order, multiply them and display the
resultant matrix. ( Read values of m,n,p,q by using Scanner class)
 Explain the following methods used in the StringBuffer class with examples.
1. append() 2. insert() 3. replace() 4. delete()
 Why wrapper classes are required? Explain autoboxing and unboxing with suitable examples of
each.
 Explain the following with an example:
i) this ii) super iii) final
 What is the difference between Error and exception? Write a java program to illustrate the usage of
multiple catch handlers.
 Explain the usage of Serialization in Java with an example.
 Write a Java program to implement Polymorphism. (Note: Consider a scenario, Bank is a class that
provides method to get the rate of interest. But, rate of interest may differ according to banks. For
example, SBI, ICICI and AXIS banks are providing 8.4%, 7.3% and 9.7% rate of interest
 What do you mean by deadlock? Explain with an example.
 What is user defined Exception in Java? WAP to accept student age and check whether he is eligible
to vote or not? Show an appropriate message when the age is not eligible.
 State the difference between Method overloading and method overriding with example.
 Differentiate between class and interface with suitable example?

You might also like