Java/Java Mcq Question Set 4 Sample Test,Sample questions

Question:
Which of the following is correct way of implementing an interface salary by class manager?

1.class manager imports salary {}

2.class manager extends salary {}

3.class manager implements salary {}

4.None


Question:
Which of the following is incorrect statement about packages?

1.Interfaces are specified public if they are to be accessed by any code in the program.

2.All variables in interface are implicitly final and static.

3.Interfaces specifies what class must do but not how it does.

4.All variables are static and methods are public if interface is defined pubic.


Question:
Which of the following package stores all the standard java classes?

1.java

2.lang

3.util

4.java.packages


Question:
Which of these access specifiers can be used for an interface?

1.private

2.Public

3.Protected

4.All of the above


Question:
Which of these can be used to fully abstract a class from its implementation?

1.Objects

2.Packages

3.Interfaces

4.None


Question:
Which of these class is related to all the exceptions that are explicitly thrown?

1.Exception

2.Error

3.Throw

4.Throwable


Question:
Which of these class is related to all the exceptions that can be caught by using catch?

1.Exception

2.Error

3.RuntimeExecption

4.All of the above


Question:
Which of these class is related to all the exceptions that cannot be caught?

1.RuntimeExecption

2.Exception

3.Error

4.All of the above


Question:
Which of these classes is not included in java.lang?

1.Integer

2.Array

3.Class

4.Byte


Question:
Which of these handles the exception when no catch is used?

1.Default handler

2.throw handler

3.Java run time system

4.finally


Question:
Which of these is a process of converting a simple data type into a class?

1.type casting

2.type wrapping

3.type conversion

4.None


Question:
Which of these is a super class of all exceptional type classes?

1.Cachable

2.String

3.RuntimeExceptions

4.Throwable


Question:
Which of these is a super class of wrappers Double & Integer?

1.Number

2.Float

3.Long

4.Digits


Question:
Which of these keywords is used by a class to use an interface defined previously?

1.Import

2.implements

3.Implements

4.import


Question:
Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?

1.throw

2.try

3.catch

4.throws


Question:
Which of these keywords is used to define interfaces in Java?

1.interface

2.intf

3.Interface

4.Intf


Question:
Which of these keywords is used to generate an exception explicitly?

1.finally

2.catch

3.throw

4.try


Question:
Which of these keywords is used to manually throw an exception?

1.catch

2.try

3.throw

4.finally


Question:
Which of these keywords must be used to handle the exception thrown by try block in some rational manner?

1.catch

2.throw

3.finally

4.try


Question:
Which of these operator is used to generate an instance of an exception than can be thrown by using throw?

1.thrown

2.new

3.malloc

4.alloc


More MCQS

  1. Java Mcq Question Set 1
  2. Java Mcq Question Set 2
  3. Java Mcq Question Set 3
  4. Java Mcq Question Set 4
  5. Java Mcq Question Set 5
  6. Java Mcq Question Set 6
  7. Java Mcq Question Set 7
  8. Java Mcq Question Set 8
  9. Java Mcq Question Set 9
  10. Java Multiple Choice Questions
  11. DATA TYPES IN JAVA
  12. Classes ,Constructor ,Methods,Inheritance
  13. Java Multiple Choice Questions.
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!