PRACTICE JAVA
Which of the following is not a java keyword?
a. double b. then c. switch d. instanceof Answer: b. then Explanation: Valid keywords in java are double, int , switch, etc.
Which of the following is not a type of repetition statement in java?
A. while statement B. do…while statement C. for statement D. loop statement Answer: D. loop statement Explanation: Repetition statement in java are while loop , do while loop and for loop.
What is the difference between the file MyProgram.java and the file MyProgram.class?
a. MyProgram.java is a compiled executable class file that is run by the computer, and MyProgram.class is a source code file typed by the programmer b. MyProgram.class is a compiled executable class file that is
The expression “java” + 1 + 2 + 3 evaluates to ________.
a. java5 b. java123 c. java12 d. Error Answer: b. java123 Explanation: In java, whenever we concatenate string followed by integers, all the integers get concatenated.
When saving a java source file, save it with an extension of
a. .class b. .java c. .py d. .asp Answer: b. .java Explanation: We always save java files with the extension .java.
The conditional AND operator in java, c++, and c# is ____.
a. | b. & c. || d. && Answer: d. && Explanation: && is the conditional AND operator used in Java, C++ and C#.
Aniket Malik
CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS
My students are the presents from God to me
Do you want to learn
Programming?
Hey, I’m Aniket. I’m determined to make you one of the best developers in the history of Information technology.
My only question is, are you ready?