Tag: java
Questions Related to java
-
Methods and variables
-
class
-
variables
-
Methods
-
class, if, void, long, Int, continue
-
goto, instanceof, native, finally, default, throws
-
try, virtual, throw, final, volatile, transient
-
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
-
int [] myList = {"1", "2", "3"};
-
int [] myList = (5, 8, 2);
-
int myList [] [] = {4,9,7,0};
-
int myList [] = {4, 3, 7};
-
method
-
native
-
subclasses
-
reference
-
interface
-
string
-
Float
-
unsigned
-
Array a = new Array(5);
-
int [] a = {23,22,21,20,19};
-
int a [] = new int[5];
-
int [5] array;
-
public double methoda();
-
public final double methoda();
-
static void methoda(double d1);
-
protected void methoda(double d1);
-
boolean b1 = 0;
-
boolean b2 = 'false';
-
boolean b3 = false;
-
boolean b4 = Boolean.false();
Correct Option: C
Explanation:
A boolean can only be assigned the literal true or false.
-
String s1 = null;
-
String s2 = 'null';
-
String s3 = (String) 'abc';
-
String s4 = (String) '\ufeed';
-
-128 to 127
-
-(215) to (215) - 1
-
0 to 32767
-
0 to 65535