0

Java Language fundamental quiz

Description: Java Language fundamental quiz
Number of Questions: 10
Created by:
Tags: java java
Attempted 0/10 Correct 0 Score 0

Overriding and Overloading is for ?

  1. Methods and variables

  2. class

  3. variables

  4. Methods


Correct Option: D
  1. class, if, void, long, Int, continue

  2. goto, instanceof, native, finally, default, throws

  3. try, virtual, throw, final, volatile, transient

  4. strictfp, constant, super, implements, do


Correct Option: B
Explanation:

All the words in option B are among the 49 Java keywords. Although goto reserved as a keyword in Java, goto is not used and has no function.Option A is wrong because the keyword for the primitive int starts with a lowercase i.Option C is wrong because "vi

Which will legally declare, construct, and initialize an array?

  1. int [] myList = {"1", "2", "3"};

  2. int [] myList = (5, 8, 2);

  3. int myList [] [] = {4,9,7,0};

  4. int myList [] = {4, 3, 7};


Correct Option: D
  1. method

  2. native

  3. subclasses

  4. reference


Correct Option: B
  1. interface

  2. string

  3. Float

  4. unsigned


Correct Option: A

Which one of the following will declare an array and initialize it with five numbers?

  1. Array a = new Array(5);

  2. int [] a = {23,22,21,20,19};

  3. int a [] = new int[5];

  4. int [5] array;


Correct Option: B

Which is the valid declarations within an interface definition?

  1. public double methoda();

  2. public final double methoda();

  3. static void methoda(double d1);

  4. protected void methoda(double d1);


Correct Option: A
  1. boolean b1 = 0;

  2. boolean b2 = 'false';

  3. boolean b3 = false;

  4. boolean b4 = Boolean.false();


Correct Option: C
Explanation:

A boolean can only be assigned the literal true or false.

Which is a valid declarations of a String?

  1. String s1 = null;

  2. String s2 = 'null';

  3. String s3 = (String) 'abc';

  4. String s4 = (String) '\ufeed';


Correct Option: A
  1. -128 to 127

  2. -(215) to (215) - 1

  3. 0 to 32767

  4. 0 to 65535


Correct Option: D
- Hide questions