CS8392 Object Oriented Programming MCQ 4
CS8392 Object Oriented Programming MCQ 4
CS8392 Object Oriented Programming MCQ 4
in
Question Bank
Unit 1
MCQ
1 Java is developed by ___________________
a)Sun Microsystems of USA b) Microsoft
c)Adobe d) None
3 ____________ is one of the java features that enables java program to run anywhere
anytime.
a)Object-Oriented b) Multithreaded
c)Platform-Independent d) Dynamic & Extensible
4 _____________ is one of the java features that can handle multiple tasks
simultaneously.
a)Object-Oriented b) Dynamic & Extensible
c)Platform-Independent d) Multithreaded
9 The ____________ includes hundred of classes and methods grouped into several
function packages.
a)API b) JVM
c)JAVAC d) JRE
www.studymaterialz.in
10 The java interpreter uses ____________ method before any objects are created.
a)Class b) Main
c)Constructor d) All of above
16 Casting from byte to __________ data type, the result is no loss information.
a)short b) int
c)long d) all of above
17 Casting from shot to __________ data type, the result is no loss information.
a)byte b) int
c)long d) double
___________ refer to fix value that does not change during the execution of a
18
program.
a)variables b) constants
c)identifiers d) integer
a)Relational b) Mathematical
c)Arithmetic d) Assignment
25 Which statement is use to skip the loop and continue with the next iteration?
a)continue b) terminate
c)skip d) break
26 _________ is a group of contiguous or related data items that share a common name.
a)Variable b) Array
c)Constant d) none
28 Java __________________.
a)Only compiles b) Only interprets
c)Compiles and then interprets d) Interprets & then compiles
Answers of MCQ:
1. (a), 2. (b), 3. (c), 4. (d), 5. (a), 6. (b), 7. (c), 8. (d), 9. (a), 10. (b), 11. (c), 12. (d),
13. (a), 14. (b), 15. (d), 16. (d), 17. (a), 18. (b), 19. (c), 20. (d), 21. (a), 22. (b), 23. (c),
24. (d), 25. (a), 26. (b), 27. (c), 28. (c), 29. (b)
Short Questions
1 Java is platform-independent and portable. - Justify.
2 Java is distributed language – Justify.
www.studymaterialz.in
Long Questions
1 What is Java? Explain the features of Java.
2 Describe the Java environment.
3 Explain the structure of Java program.
4 Explain the data types available in Java.
5 Explain type casting with example.
6 Explain the scope of variable.
7 List out the decision making statements available in Java. Explain with example.
8 List out the looping statements available in Java. Explain with example.
9 Explain break and continue statements with example.
10 List out the operators. Explain anyone in detail.
Unit -2
MCQ
1 Range of short variable is ______________
a) -128 to 128 b) -128 to 127
c) -32768 to 32767 d) -32768 to 32768
3 __________ variables and methods can be called without using the objects.
a)static b) final
c)abstract d) none of the above
6 If two methods have same name but different parameter list then it is
called___________
a) Method overriding b) Method overloading
c)Operator overloading d) None of these
9 The mechanism of deriving a new class from an old one is called ______________.
a)Method overriding b) Method overloading
c)Operator overloading d) Inheritance
12 The subclass constructor uses the ________ keyword to invoke the constructor of the
superclass.
a)super b) Final
c)static d) public
13 __________ is a special method in java that enables an object to initialize itself when
it is created.
a)constructor b) destructor
c)static d) final
Answers of MCQ:
1. (c), 2. (a), 3. (a), 4. (b), 5. (b), 6. (a), 7. (a), 8. (a), 9. (d), 10. (c), 11. (c), 12. (a),
13. (a), 14. (a), 15. (b), 16. (d)
Short Questions
1 Write various types of inheritance.
2 Define method overloading.
3 Define fields and methods of a class in JAVA.
4 Define constructor. How do we invoke constructor in JAVA?
5 Define method overriding.
6 Define Inheritance. How it is created in Java?
7 Define interface. Write the syntax for implementing an interface in a class.
8 What is the meaning of the static keyword?
9 What are the restrictions with static methods?
10 Differentiate between Classes and Interface.
11 Define the final variable and final methods.
12 Define class. How does it accomplish data hiding?
13 What is the meaning of the abstract keyword?
14 What are the conditions for using super() method.
Long Questions
1 Define class. How do classes help us to organize our programs? What are the three
parts of a simple, empty class?
2 What is a constructor? What are its special properties?
3 Define inheritance. Describe different forms of inheritance.
4 Explain super and final keyword with example.
5 Describe the various forms of implementing interface. Give an example of JAVA
code for each case.
6 When do we declare a method or class abstract? Discuss with one Example.
7 Write short note on method overloading and method overriding.
Unit – 3
www.studymaterialz.in
Unit – 3
MCQ
1 All syntax errors are known as _____________ errors.
a) Run-time b) Exception
c) Logical d) Compile-time
5 If we want the program to continue with the execution of the remaining code, then
we should try to catch the exception object thrown by the error condition and then
display an appropriate message for taking corrective action is known as
_________________.
a)Exception handling b) BufferedReader
c)Try d) Catch
12 ____________method is used to find the nth no. of character of given string s1.
a)s1.index(n) b) s1.substring(n)
c)s1.length() d) s1.charAt(n)
Answers of MCQ:
1.(d), 2. (d), 3. (b), 4. (a), 5. (a), 6. (b), 7. (d), 8. (a), 9. (b), 11. (c), 12. (d)
Short Questions
1 Give examples of the Run-time error.
2 List out the different types of exception.
3 Define the terms: try, catch.
4 Define the term - stream, reader stream classes, writer stream classes.
5 Explain any two string methods.
6 List the java API packages.
7 List the methods of Reader or Writer class.
8 Define the term – Exception and Exception Handling.
Long Questions
1 Explain Arithmetic Exception with an example.
2 What is exception? Explain the syntax of try block and catch block with an
example.
3 Describe concept of stream.
4 Explain Reader stream classes and Writer stream classes.
5 Write a short note on Character Stream classes.
6 List out any five methods of String class by giving an example.
7 What is package? What are the benefits of package? Explain Java API packages.
8 Describe the try and catch statements in detail.
Unit 4
MCQ
1 The __________ parameter is used to specify the applet class name.
a)classname b) code
c) name d) codebase
www.studymaterialz.in
3 Through the applet life cycle _______________ state occur only once.
a) Running b) Idle
c) Born d) None of these
c) JDC d) OBDC
Answers of MCQ:
1. (b), 2. (c), 3. (c), 4. (b), 5. (a), 6. (c), 7. (c), 8. (d), 9. (b), 10. (d), 11. (a), 12 .(a),
13. (b), 14. (a)
Short Questions
1 What is event delegation?
2 List out methods of MouseListener.
3 Define (1) Event (2) Event Source (3) Event Class (4) Event Listener
4 Explain methods (1) setBackground( ) (2) setForeground( )
5 Explain types of drivers used in JDBC.
6 Write difference between java applet program and java application program.
7 List down methods for KeyEvent class and ItemEvent class.
Long Questions
1 Explain Applet life cycle in detail.
2 What is JDBC? List out JDBC components and types of drivers.
3 Write short note on following components.
(1) Label
(2) TextField
(3) TextArea
(4) List
(5) Choice
(6) Button
(7) Checkbox