Tag Archives: java questions

Top 20 Java Programming MCQ’s Questions and Answers

               

  1. What is the range of short data type in Java?
    1. -32768 to 32767
    2. -128 to 127
    3. -2147483648 to 2147483647
    4. None of the mentioned                                                                                                                                      Ans a.( -32768 to 32767)
  2. Which of these literals can be contained in float data type variable?

Java Programming MCQ’s Questions and Answers

                                   

  1. Which of these operators is used in Java to allocate memory to array variable?
    1. Malloc
    2. New
    3. Alloc
    4. new malloc

Ans c.(new)

2.Which of these is incorrect array declaration?

  1. int arr[]     arr = new int[5]
  2. int [] arr = new int[5]