Java Questions Sheet - 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

JAVA QUESTIONS SHEET - 1

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.

What are the principles of Object Oriented Programming?


Why Object Oriented Programming is suitable for real world solutions?
How Class is different to a structure in C?
What are the features of Java?
Java is Robust and Secure Justify
How java is platform independent?
What is the role of JVM? What is a JRE?
What is the difference between weak and strong encapsulation?
What do you understand by a Class and an Object?
How you add a property/state for an object in a class?
How you add a method/behavior for an object in a class?
What is the difference between static and non-static members?
Write a code to create an object of a class that is being already written by you. Access its properties
and invoke its behavior.
What is method overloading? When it fails?
What is a role of Constructors in Java? How they are invoked?
What a compiler does, if it does not find a constructor definition in a class?
Why java does provide a concept of Constructor Overloading?
Write a class that can have maximum one object only.
What is the role of this keyword in Java? What is the use of this()?
What do you understand by constructor chaining in java? Why it is required?
What are the anonymous and static blocks in java? Also mention their roles.
Write a class that inherits the behavior and properties from the parent class.
Why java does not support multiple inheritance by means of classes?
What is method overriding? What are the conditions of method overriding?
What is the role of super and super()?
What do you understand by an abstract class? What is the purpose of making abstract classes?
What is the significance of using Interfaces in java?
Write a code for an interface that inherits another interface.
What do you understand by loose coupling and tight coupling?
What do you understand by IS - A and HAS - A relationship?
What is a concept of composition and generalization?
What are packages? What feature of java is achieved by packages?
How can you create a package and add classes to it? (Using cmd and eclipse)
How can you use a class present in another package?
Discuss the various access modifiers available in java.
Write a code to demonstrate the difference protected and default

You might also like