Quiz
Untitled
Questions in this quiz (5)
1Which of the following is NOT a primitive data type in Java?
- Achar
- Bdouble
- Cint
- Dnumber
2Which of the following lines declares a constant holding the value 42 in Java?
- A[A] static final int ANSWER = 42;
- B[B] static const int ANSWER = 42;
- C[C] static final ANSWER = 42;
- D[D] static const ANSWER = 42;
3Which of the following is NOT a java.util.Scanner method?
- A[A] getNext
- B[C] next
- C[B] hasNext
- D[D] nextDouble
4What output will be produced by the following Java program?
boolean a = true;
boolean b = false;
a = a && b;
b = ! b;
System.out.println(a + " " + b);- Afalse false
- Bfalse true
- Ctrue false
- Dtrue true
5What output will be produced by the following Java program?
int a = 1;
int b = 1;
while (a * b < 10) {
a += b;
if (a == 4)
continue;
b++;
}
System.out.println(a + b);- A7
- B8
- C9
- D10
Information
- Description
- Quiz on Untitled, created by ljh hlk on 31/05/2017.
- Author
- ljh hlk
- Language
- English
- Views
- 0
- Rating
- No ratings yet Rate this quiz