core java programming
this test based on core java programming for improving technical skill in core java
Questions
Which of the following is serializable?
- Interface
- Public interface
- Public class
- Private class
What will be the output of the given program?
class MyClass { public static void main(String AR[]) { short a = 36768; System.out.println(a); } }
- Run time error
- Successful execution
- Compile time error
- None of these
Which wrapper class does not contain string as argument?
- Integer
- Character
- Boolean
- None of these
What is 'instanceof'?
- It is an operator.
- It is a keyword.
- It is an interface.
- None of these
Which of the following is used for calling constructor?
- this
- super
- both (1) and (2)
- none of these
Methods, which are declared in interface are by default___________
- public and non-static
- default and abstract
- private and static
- public and abstract
What is access specifier of finalize() method?
- Default
- Public
- Protected
- Private
Default value of char is
- 0
- false
- null
- u0000
Which accessible modifier is known as 'package accessible modifier'?
- Public
- Private
- Default
- Protected
Compiler enforces us to deal with ______ exceptions.
- checked
- unchecked
- both (1) and (2)
- none of these
The non-static block is called ____________________
- as soon as class gets loaded
- by explicitly
- when object is created
- none of these
Which of the following is not primitive data type?
- int
- Long
- String
- Float
What is return type of hashcode() method?
- int
- Long
- String
- Hashcode
Which of the followig is not a comment?
- /* */
- //
- /** **/
- None of these
What do we use to have multiple threads of execution running concurrently?
- Extends Thread
- Extends Runnable
- Implements Runnable
- Both (1) and (3)