Must know Technical Questions

Must know Technical Questions

The underlined options are the correct answers. Read and learn!

rn

Q1. What is garbage collection in the context of Java?

rn

1. The JVM checks the output of any Java program and deletes anything that doesn’t make sense.

rn

2. Any package imported in a program and not used is automatically deleted.

rn

3. The operating system periodically deletes all of the java files available on the system.

rn

4. When all references to an object are gone, the memory used by the object is automatically reclaimed.

rn

Q2. Which class cannot be sub classed (or extended) in java?

rn

1. Parent class

rn

2. Final class

rn

3. Abstract class

rn

4. None of these

rn

Q3. Which package is used for creating and implementing applets?

rn

1. java.util

rn

2. java.applet

rn

3. java.awt

rn

4. java.lang

rn

Q4. __________ Variables and methods can be called without using the objects.

rn

1. Abstract

rn

2. None of these

rn

3. Final

rn

4. Static

rn

Q5. Runnable is?

rn

1. Variable

rn

2. Class

rn

3. Interface

rn

4. Method

rn

Q6.____________ are utilized to control the access to an object especially in multi-threaded programming

rn

1. Synchronized methods

rn

2. Serialized methods

rn

3. Asynchronized methods

rn

4. None 

rn

Q7. In Runnable, many threads share the same object instance. True or False?

rn

1. Can’t be determined

rn

2. True

rn

3. Always false

rn

4. False but not always 

rn

Q8.__________ is a special method in java that enables an object to initialize itself when it is created.

rn

1. Constructor

rn

2. Final

rn

3. Destructor

rn

4. Static

rn

Q9.If method have same name as class name and method don’t have any return type then it is known as

rn

1. Constructor

rn

2. Object

rn

3. Variable

rn

4. Destructors 

rn

Q10.Decrement operator, –, decreases value of variable by what number?

rn

1. 3

rn

2. 4

rn

3. 2

rn

4. 1

c