OOP Question Bank
OOP Question Bank
Question Bank
Set 1(PT, Mid Questions)
1. Explain with neat labelled diagram typical java Development Environment.
2 .Explain following keywords: public. Static, void, main, String args [] also explain
Compilation &execution process with one Example.
3 .write short note on silent features of java.
4. Write a java code create class Student, instance variable name, roll number, age using create
and display method.
5. Explain Control statement in Java
6. Differentiate between Class &Object.
7. Differentiate between Primitive Data Type &Reference Data Type
10. Write a Java program to create a class Rectangle and Data members’ length and width
calculate area of rectangle using Method.
11. Write java code using for Switch Statement to check Vowel or Consonant:
12. Write java code using for Switch Statement to display 10 th Months with Number
13. Explain with neat labelled diagram typical java Development Environment.
14. Explain following keywords: public. Static, void, main, String args [] also explain
Compilation &execution process with one Example.
15. Write short note on silent features of java.
16. Write a java code create class Student, instance variable name, roll number, age using create
and display method.
17. Explain Control statement in Java.
18. Define inheritance. What are the benefits of inheritance? How to prevent a class from
inheritance?
20. Define polymorphism. Explain run time polymorphism with the help of Example.
21. What are the difference between error and exception? Explain with the help of example.
22. How to create user Defined exception.
Q.2 Solve Any Two of the following. A) What are the benefits of break and continue
statements explain with example? (Analysis) 6
B) Discuss default constructor and parameterized constructor with the help of an example in
Java? (Application) 6
C) How do we implement polymorphism in JAVA? Explain briefly (Understand) 6
Q. 3 Solve Any Two of the following.
A) a) Write a program to find the smallest and largest number from given input array? For
example: Input: arr[]={13,4,2,5,9} Output : Maximum is 13 and Minimum is 2 (Application))
6
B) Write a program to check whether enter number is palindrome or not? (Application) 6
C) Write the differences between interface and abstract class (Understand) 6
Q.6What are the benefits of break and continue statements explain with Example?
Q.7 Discuss default constructor and parameterized constructor with the help of an example in
Java?
Q8. What are the advantages of the object-oriented programming language?
Q9. Write a program to find the smallest and largest number from given Input array?
Input: arr[]={13,4,2,5,9}
Output: Maximum is 13 and Minimum is
Q10. Write a program to check whether enter number is palindrome or not?
Set 4(MCQ)
Object Oriented Programming in Java MCQ with
Answers
1. Which of the following is an object encapsulated inside the
System class?
A) out
B) println
C) Both A and B
D) None of the above
14. Which loop always executes its body at least once, even
though the condition is not true:
A) for
B) do-while
C) while
D) continue
16. Which of the following method can be used to set the size of
the buffer:
A) ensureCapacity( )
B) length( )
C) capacity( )
D) setLength( )
20. Both the String and StringBuffer classes are defined in ____
package:
A) java.awt
B) java.io
C) java.lang
D) java.util
22. Human Being and Elephant fall under which of the following
relationship:
A) Kind-Of
B) Is-A
C) Part-Of
D) Has-A
24. A class member that has been declared as private will be ___
to its class.
A) Friendly
B) Public
C) Protected
D) Private
36. Which of the following class lays the foundation for the
output class hierarchy:
A) Reader
B) InputStream
C) OutputStream
D) None of the above
38. The streams that are read from or written to a specific place
like a disk file or memory:
A) Markable streams
B) ByteArray streams
C) Mode streams
D) Filter streams
39. Graphics class is a part of :
A) java.applet package
B) java.util package
C) java.io package
D) java.awt package
48. The method that returns the event ID that represents the
nature of the event:
A) getId( )
B) getNature( )
C) getName( )
D) getValue( )