0% found this document useful (0 votes)
1 views5 pages

Java Important Questions

The document covers various Java concepts including buzzwords, constructors, packages, interfaces, inheritance, threading, recursion, and the 'this' keyword. It also includes multiple-choice questions, fill-in-the-blank statements, and true/false questions related to Java programming. Additionally, it provides examples and justifications for key concepts such as method overriding and the use of the 'super' keyword.

Uploaded by

kvenu8637
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views5 pages

Java Important Questions

The document covers various Java concepts including buzzwords, constructors, packages, interfaces, inheritance, threading, recursion, and the 'this' keyword. It also includes multiple-choice questions, fill-in-the-blank statements, and true/false questions related to Java programming. Additionally, it provides examples and justifications for key concepts such as method overriding and the use of the 'super' keyword.

Uploaded by

kvenu8637
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1. List and explain the Java buzzwords in detail?

2. a) Define Constructor
b) Illustrate constructor overloading concept with an example.

3. a) What is a Package?
b) How to import packages? Explain with illustrations
4. a) Differentiate between interface and class
b) Justify the concept of extending interfaces with example code.
5. Explain Costs and Benefits of Inheritance
6. What is thread? Explain with example? Benefits of multi-threading?
7.a) Define Recursion.
b) Illustrate Call-By-Reference Parameter Passing technique.

8.a) Explain “this” Keyword.


b) Discuss about anonymous inner classes with example.

9. a) Define Inheritance?
b) Explain the various forms of inheritance with suitable code segments.

10. What is interface? Explain how to implement interface in java?

11. What is java package? What is CLASSPATH? Explain how to create and
access java package with an example?
12. Write a program to illustrate the use of multiple catch blocks for a try
block?

13. a) Design a java program to find the factorial of a given number.


b) Justify method overriding with a suitable example program.
14. With suitable program segments describe the usage of ‘super’ keyword.
15. Support the statement java byte code gives high performance justify?
16. What features makes a java is robust language?
17. Does java supports multi way selection statements? Justify?
18. Design an interface called Shape with methods draw() and getArea().
Further design two classes called Circle and Rectangle that implements Shape
to compute area of respective shapes. Use appropriate getter and setter methods.
Write a java program for the same.
19. Differentiate between interface and abstract class
20. Explain nested interface with example?

MCQs:

1. When does method overloading is determined? [ ]


a) At run time b) At compile time
c) At coding time d) At execution time

2. What are abstract classes in Java? [ ]


a) Classes that cannot be instantiated
b) Classes that only contain abstract methods
c) Classes that can be used as blueprints for creating objects
d) All of the above

3. Which of the following is not an OOPS concept? [ ]


a)Encapsulation b) Polymorphism c)Exception d)Abstraction

4. Which feature of OOPS described the reusability of code? [ ]


a)Encapsulation b) Polymorphism c)Abstraction d) Inheritance

5. The combination of abstraction of the data and code is viewed


in__________ [ ].
a) Inheritance b) Object c)Class d)Interfaces

6. A constructor _____________. [ ]
a) May consist of a return type b) Doesn’t consist of any return type
c) Has some return type d) Of a derived class has a return type
7. The memory that is allocated for any objects is _________. [ ]
a) Cache b) HDD c) ROM d) RAM

8. What part is used to compile, debug and execute java programs? [ ]


a) JRE b) JIT c) JDK d) JVM

9. Which of the following is the superclass of all Java classes? [ ]


a) Array List b) Abstract Class c) Object class d) String

10. Which is the keyword used to inherit a class to another? [ ]


a) inherits b) extends c) Implements d) import

11. Which of the following is not a reserved keywords in Java? [ ]


a) finally b) class c) abstract d) object

12. An interface has methods that are ____________________. [ ]


a) final b) static c) abstract d) none of the above

13. Evaluate the following Java expression, if x=3, y=5, and z=10; [ ]
++z + y - y + z + x++
a) 23 b) 24 c) 25 d) 22
14. Which of these is correct way of inheriting class A by class B? [ ]
a) class B + class A {} b) class B inherits class A {}
c) class B extends A {} d) class B extends class A {}

15. Which of these is an incorrect array declaration? [ ]


a) int arr[] = new int[5] b) int [] arr = new int[5]
c) int arr[] = new int[5] d) int arr[] = int [5] new

16. Java doesn’t support ________________ inheritance. [ ]


a) Multiple b) Single c) Multi level d) Hierarchical

17. Access specifier provides only class level accessibility. [ ]


a) Public b) Protected c) Private d) None of the above
18. _____keyword is used to implement an interface. [ ]
a) extends b) this c) implements d) super

19. Java’s Character Data type follows______________code. [ ]


a) Unicode b) ASCII c) EBCDIC d) None

20. Partially implemented/defined class can be called as__________ [ ]


a) Abstract class b) interface c) concrete class d) None of the above

Fill in the blanks


1. JRE stands for____________________________________
2. _________is a unique entity that occurs in object oriented
programming.
3. In Java, Dynamic Memory allocation using ________________ operator.
4. A ________________constructor is used to copy on object into another
object of the same class.
5. In Java, Using the concept of _________________ Multiple Inheritance is
supported.
6. JVM is an interpreter for_______________________.

7. Instance of a class known as___________________.

8. Role of garbage collector is_____________________________________.

9. JDK stands for__________________________________________.

10.A _____________________ is a collection of classes and interfaces.


True (or) False

1. Java is purely Object Oriented Programming Language. ( )


2. JVM is platform-Dependent software. ( )
3. A package statement can occur either before or after import statements
( )
4. Under inheritance, a superclass inherits all of the members in all of its
subclasses. ( )
5. Java byte codes are compiled instructions that execute directly on the
host system
( )
6. Java’s Byte code Platform-Dependent. ( )
7. The Object class is the highest superclass of Java. ( )
8. Boolean values can be cast into any other primitive type. ( )
9. It is necessary to implement all the methods of an interface while
implementing the interface. ( )
10.In Object class, toString() method converts String into Object. ( )

You might also like