WorksheetsJava Fundamentals - 2
Total questions: 10
Worksheet time: 13mins
Which of the following Statement is an example of Console Input Statement in JAVA
System.in
Scanner
BufferedReader
System.out
Which of the following is a valid array initialization in java
int a[]=new int[3]{1,2,3,4};
int []a =new int[]{4,5,6};
int a[3]={1,2,3};
int a[]=new int[4]{1,2,3,4,5};
Arrays class is belongs to the following package
import java.util.*
import java.lang.*;
import java.io.*;
import java.awt.*;
By default random() method generates random numbers between
1 to 10
0.0 to 0.1
0.0 to 1.0
1 to 100
Which of the following is/are valid console output statement(s) in java
System.out.println("GEC");
System.out.print("GEC");
System.out.printf("GEC");
System.out.printline("GEC");
What is the output of the following Statement
int a= - 10
System.out.println(~a);
11
-5
5
9
What is the output of the following Arithmetic Expression
39-28/3/3%3*21
21
11
39
6
Which of the following is/are Invalid Underscore Literal(s)
78_9_2
34_.6_7
89__3_
2_________000
Which of the following is/are valid character literal(s)
'\a'
's'
'\u0061'
'u21'
Which of the following array declaration is invalid
int a[]={4,5,6,7,87};
int a[][]={new int[3],new int[4],new int[2]};
int []a[]=new int[][]{{1,2,3,4},{1,2},{9}};
int [][]a={{1,2},new int[3],{58,9,1,2}};
None of these
