core java programming

this test based on core java programming for improving technical skill in core java

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is serializable?

  1. Interface
  2. Public interface
  3. Public class
  4. Private class
Question 2 Multiple Choice (Single Answer)

What will be the output of the given program?
class MyClass { public static void main(String AR[]) { short a = 36768; System.out.println(a); } }

  1. Run time error
  2. Successful execution
  3. Compile time error
  4. None of these
Question 3 Multiple Choice (Single Answer)

Which wrapper class does not contain string as argument?

  1. Integer
  2. Character
  3. Boolean
  4. None of these
Question 4 Multiple Choice (Single Answer)

What is 'instanceof'?

  1. It is an operator.
  2. It is a keyword.
  3. It is an interface.
  4. None of these
Question 5 Multiple Choice (Single Answer)

Which of the following is used for calling constructor?

  1. this
  2. super
  3. both (1) and (2)
  4. none of these
Question 6 Multiple Choice (Single Answer)

Methods, which are declared in interface are by default___________

  1. public and non-static
  2. default and abstract
  3. private and static
  4. public and abstract
Question 7 Multiple Choice (Single Answer)

What is access specifier of finalize() method?

  1. Default
  2. Public
  3. Protected
  4. Private
Question 8 Multiple Choice (Single Answer)

Default value of char is

  1. 0
  2. false
  3. null
  4. u0000
Question 9 Multiple Choice (Single Answer)

Which accessible modifier is known as 'package accessible modifier'?

  1. Public
  2. Private
  3. Default
  4. Protected
Question 10 Multiple Choice (Single Answer)

Compiler enforces us to deal with ______ exceptions.

  1. checked
  2. unchecked
  3. both (1) and (2)
  4. none of these
Question 11 Multiple Choice (Single Answer)

The non-static block is called ____________________

  1. as soon as class gets loaded
  2. by explicitly
  3. when object is created
  4. none of these
Question 12 Multiple Choice (Single Answer)

Which of the following is not primitive data type?

  1. int
  2. Long
  3. String
  4. Float
Question 13 Multiple Choice (Single Answer)

What is return type of hashcode() method?

  1. int
  2. Long
  3. String
  4. Hashcode
Question 14 Multiple Choice (Single Answer)

Which of the followig is not a comment?

  1. /* */
  2. //
  3. /** **/
  4. None of these
Question 15 Multiple Choice (Single Answer)

What do we use to have multiple threads of execution running concurrently?

  1. Extends Thread
  2. Extends Runnable
  3. Implements Runnable
  4. Both (1) and (3)