Java Programming MCQ (Multiple Choice Questions) - SchoolingAxis

Java Programming MCQ (Multiple Choice Questions)

 Que-  Which of these methods is not defined in both Byte and Short wrappers?

a. intValue()

b. isInfinite()

c. toString()

d. hashCode()


Answer- isInfinite()


Que-  Which of these methods of Character wrapper can be used to obtain the char value contained in Character object.

a. get()

b. getVhar()

c. charValue()

d. getCharacter()


Answer- charValue()


Que-  Which of the following constant are defined in Character wrapper?

a. MAX_RADIX

b. MAX_VALUE

c. TYPE

d. All of the mentioned


Answer- All of the mentioned


Que-  Which of these is a super class of Character wrapper?

a. Long

b. Digits

c. Float

d. Number


Answer- Number


Que-  Which of these methods is used to know whether a given Character object is part of Java's Identifiers?

a. isIdentifier()

b. isJavaIdentifier()

c. isJavaIdentifierPart()

d. none of the mentioned


Answer- isJavaIdentifierPart()


Que-  Which of these coding techniques is used by method isDefined()?

a. Latin

b. ASCII

c. ANSI

d. UNICODE


Answer- UNICODE


Que-  Which of these class contains all the methods present in Math class?

a. SystemMath

b. StrictMath

c. Compiler

d. ClassLoader


Answer- StrictMath


Que-  Which of these method return a pseudorandom number?

a. rand()

b. random()

c. randomNumber()

d. randGenerator()


Answer- random()


Que-  Which of these method returns the remainder of dividend / divisor?

a. remainder()

b. getRemainder()

c. CSIremainder()

d. IEEEremainder()


Answer- IEEEremainder()


Que-  Which of these method converts radians to degrees?

a. toRadian()

b. toDegree()

c. convertRadian()

d. converDegree()


Answer- toDegree()


Que-  toRadian() and toDegree() methods were added by which version of Java?

a. Java 1.0

b. Java 1.5

c. Java 2.0

d. Java 3.0


Answer- Java 2.0


Que-  Which of these method returns a smallest whole number greater than or equal to variable X?

a. double ciel(double X)

b. double floor(double X)

c. double max(double X)

d. double min(double X)


Answer- double ciel(double X)


Que-  Which of these classes encapsulate runtime environment?

a. Class

b. System

c. Runtime

d. ClassLoader


Answer- Runtime


Que-  Which of the following exceptions is thrown by every method of Runtime class?

a. IOException

b. SystemException

c. SecurityException

d. RuntimeException


Answer- SecurityException


Que-  Which of these methods returns the total number of bytes of memory available to the program?

a. getMemory()

b. TotalMemory()

c. SystemMemory()

d. getProcessMemory()


Answer- TotalMemory()


Que-  Which of these Exceptions is thrown by loadClass() method of ClassLoader class?

a. IOException

b. SystemException

c. ClassFormatError

d. ClassNotFoundException


Answer- ClassNotFoundException


Que-  Which of these classes encapsulate runtime state of an object?

a. Class

b. System

c. Runtime

d. Cache


Answer- Class


Que-  Which of these methods returns the class of an object?

a. getClass()

b. Class()

c. WhoseClass()

d. WhoseObject()


Answer- getClass()


Que-  Which of these methods return a class object given its name?

a. getClass()

b. findClass()

c. getSystemClass()

d. findSystemClass()


Answer- findSystemClass()


Que-  Which of these class defines how the classes are loaded?

a. Class

b. System

c. Runtime

d. ClassLoader


Answer- ClassLoader


Que-  Which of the interface contains all the methods used for handling thread related operations in Java?

a. Runnable interface

b. Math interface

c. System interface

d. ThreadHandling interface


Answer- Runnable interface


Que-  Which of these class is used to make a thread?

a. String

b. System

c. Thread

d. Runnable


Answer- Thread


Que-  Which of this interface is implemented by Thread class?

a. Runnable

b. Connections

c. Set

d. MapConnections


Answer- Runnable


Que-  Which of these methods of a Thread class is used to suspend a thread for a period of time?

a. sleep()

b. terminate()

c. suspend()

d. stop()


Answer- sleep()


Que-  Which object Java application uses to create a new process?

a. Process

b. Builder

c. ProcessBuilder

d. CreateBuilder


Answer- ProcessBuilder


Que-  Which of the following is true about Java system properties?

a. Java system properties are accessible by any process

b. Java system properties are accessible by processes they are added to

c. Java system properties are retrieved by System.getenv()

d. Java system properties are set by System.setenv()


Answer- Java system properties are accessible by processes they are added to


Que-  Java system properties can be set at runtime.

a.TRUE

b.FALSE

c.Nothing Can be Said

d.None of the mentioned


Answer-TRUE

Previous Post Next Post