InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
From where break statement causes an exit?(a) Only from innermost loop(b) Terminates a program(c) Only from innermost switch(d) From innermost loops or switchesI got this question by my school principal while I was bunking the class.This question is from Control Statements topic in section Operators and Control Statements of Java |
|
Answer» The CORRECT choice is (d) From INNERMOST loops or switches |
|
| 2. |
Which of the following is not a decision making statement?(a) if(b) if-else(c) switch(d) do-whileThe question was posed to me in my homework.This interesting question is from Control Statements in portion Operators and Control Statements of Java |
|
Answer» Correct choice is (d) do-while |
|
| 3. |
Which of the following is not a valid jump statement?(a) break(b) goto(c) continue(d) returnI had been asked this question during an online exam.My question is from Control Statements topic in chapter Operators and Control Statements of Java |
|
Answer» The CORRECT choice is (b) goto |
|
| 4. |
What is true about do statement?(a) do statement executes the code of a loop at least once(b) do statement does not get execute if condition is not matched in the first iteration(c) do statement checks the condition at the beginning of the loop(d) do statement executes the code more than once alwaysI have been asked this question in examination.Question is from Control Statements topic in section Operators and Control Statements of Java |
|
Answer» Right choice is (a) do statement executes the code of a loop at LEAST once |
|
| 5. |
Which of the following is used with the switch statement?(a) Continue(b) Exit(c) break(d) doThis question was addressed to me in final exam.The above asked question is from Control Statements topic in section Operators and Control Statements of Java |
|
Answer» Right OPTION is (c) break |
|
| 6. |
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?(a) do-while(b) while(c) for(d) none of the mentionedI got this question in an online interview.My enquiry is from Control Statements in portion Operators and Control Statements of Java |
|
Answer» RIGHT OPTION is (a) do-while To ELABORATE: NONE. |
|
| 7. |
Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?(a) break(b) return(c) exit(d) continueI have been asked this question in unit test.My question is based upon Control Statements in section Operators and Control Statements of Java |
|
Answer» CORRECT OPTION is (d) continue To ELABORATE: NONE. |
|
| 8. |
The while loop repeats a set of code while the condition is not met?(a) True(b) FalseI had been asked this question by my school teacher while I was bunking the class.This interesting question is from Control Statements topic in section Operators and Control Statements of Java |
|
Answer» Right CHOICE is (B) False |
|
| 9. |
What is true about a break?(a) Break stops the execution of entire program(b) Break halts the execution and forces the control out of the loop(c) Break forces the control out of the loop and starts the execution of next iteration(d) Break halts the execution of the loop for certain time frameThis question was addressed to me in my homework.My question comes from Control Statements topic in section Operators and Control Statements of Java |
|
Answer» CORRECT choice is (b) Break halts the EXECUTION and forces the control out of the loop For EXPLANATION: Break halts the execution and forces the control out of the loop. |
|
| 10. |
Which of these are selection statements in Java?(a) if()(b) for()(c) continue(d) breakI had been asked this question in homework.This interesting question is from Control Statements topic in portion Operators and Control Statements of Java |
|
Answer» The CORRECT choice is (a) if() |
|
| 11. |
Which of these selection statements test only for equality?(a) if(b) switch(c) if & switch(d) none of the mentionedThis question was addressed to me during an interview for a job.Question is taken from Control Statements in chapter Operators and Control Statements of Java |
|
Answer» Correct OPTION is (b) SWITCH |
|
| 12. |
Which of these have highest precedence?(a) ()(b) ++(c) *(d) >>I had been asked this question during an internship interview.The origin of the question is Assignment Operators and Operator Precedence in chapter Operators and Control Statements of Java |
|
Answer» Right choice is (a) () |
|
| 13. |
Which of these is returned by “greater than”, “less than” and “equal to”operators?(a) Integers(b) Floating – point numbers(c) Boolean(d) None of the mentionedI had been asked this question in an international level competition.My doubt is from Relational Operators and Boolean Logic Operators topic in portion Operators and Control Statements of Java |
|
Answer» Correct answer is (c) BOOLEAN |
|
| 14. |
What is the output of relational operators?(a) Integer(b) Boolean(c) Characters(d) DoubleThe question was posed to me by my school principal while I was bunking the class.This is a very interesting question from Relational Operators and Boolean Logic Operators topic in chapter Operators and Control Statements of Java |
|
Answer» The CORRECT CHOICE is (B) Boolean |
|
| 15. |
On applying Left shift operator, |
|
Answer» Right OPTION is (d) 31 |
|
| 16. |
Which operator is used to invert all the digits in a binary representation of a number?(a) ~(b) (d) ^I got this question in final exam.I'd like to ask this question from Bitwise Operators in division Operators and Control Statements of Java |
|
Answer» The CORRECT CHOICE is (a) ~ |
|
| 17. |
Which of these is not a bitwise operator?(a) &(b) &=(c) |=(d) |
|
Answer» Right option is (d) <= |
|
| 18. |
Decrement operator, −−, decreases the value of variable by what number?(a) 1(b) 2(c) 3(d) 4This question was addressed to me during an online exam.I want to ask this question from Arithmetic Operators in division Operators and Control Statements of Java |
| Answer» | |
| 19. |
Modulus operator, %, can be applied to which of these?(a) Integers(b) Floating – point numbers(c) Both Integers and floating – point numbers(d) None of the mentionedI got this question by my school teacher while I was bunking the class.The origin of the question is Arithmetic Operators in section Operators and Control Statements of Java |
|
Answer» The correct option is (C) Both INTEGERS and FLOATING – point numbers |
|
| 20. |
Which of these statements are incorrect?(a) Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms(b) Assignment operators run faster than their equivalent long forms(c) Assignment operators can be used only with numeric and character data type(d) None of the mentionedThis question was addressed to me at a job interview.Origin of the question is Arithmetic Operators in section Operators and Control Statements of Java |
|
Answer» RIGHT CHOICE is (d) NONE of the mentioned The BEST I can EXPLAIN: None. |
|
| 21. |
Which of the following can be operands of arithmetic operators?(a) Numeric(b) Boolean(c) Characters(d) Both Numeric & CharactersThis question was posed to me in my homework.Asked question is from Arithmetic Operators topic in portion Operators and Control Statements of Java |
|
Answer» CORRECT ANSWER is (d) Both Numeric & Characters For EXPLANATION: The operand of arithmetic operators can be any of numeric or CHARACTER type, But not boolean. |
|