Java Multiple Choice Questions

  1. Choose best option that describes Constructor.
    1. Have no return type
    2. Use name of the class and have no return type
    3. Use name of the class
    4. None of the above
Answer :
B
Explanation:
Added By : Prashant


  1. Overloaded methods are differentiated by
    1. Number of arguments
    2. Data type of arguments
    3. Number and the Data type of the arguments
    4. None of the above
Answer :
C
Explanation:
Added By : Prashant

  1. Which keyword is used to inherit class?
    1. inherit
    2. extends
    3. inheritance
    4. extend
Answer :
B
Explanation:
Added By : Prashant


  1. Which method of System class is used to copy array?
    1. copyArray
    2. arrayCopy
    3. arraycopy
    4. arrCopy
Answer :
C
Explanation:
Added By : Deeksha

  1. Which is right way to creating an array of integer?
    1. javaArray = new int[10];
    2. javaArray new = myArray[10];
    3. int[] javaArray = new int[10];
    4. A and C Both
Answer :
D
Explanation:
Added By : Deeksha

  1. Which is right way to declare Array?
    1. int[] myArray;
    2. int myArray[];
    3. int []myArray;
    4. A and B Both
Answer :
D
Explanation:
Added By : Deeksha


  1. How integer literal can expressed binary data?
    1. int binaryData = b11010;
    2. int binaryData = bx11010;
    3. int binaryData = 0b11010;
    4. int binaryData = xb11010;
Answer :
C
Explanation:
Added By : Deeksha

  1. If you access an uninitialized local variable will result?
    1. Syntax Error
    2. Compile Time Error
    3. Run Time Error
    4. No Error
Answer :
B
Explanation:
Added By : Deeksha

Post Your Question
Social Sharing
Search