Authored By

Statistics

Search GetGyan

Test Difficulty Level: Medium

Syllabus of Test

Questions based on SCJP

Sample Question from this online test:

Question: 11. public void foo( boolean a, boolean b ){
12. if( a ) {
13. System.out.println( “A” );
14. } else if ( a && b ) {
15. System.out.println( “A&&B” );
16. } else {
17. if ( !b ) {
18. System.out.println( “notB” );
19. } else {
20. System.out.println( “ELSE” );
21. }
22. }
23. }
What is correct?
A. If a is true and b is true then the output is “A&&B”.
B. If a is true and b is false then the output is “notB”.
C. If a is false and b is true then the output is “ELSE”.
D. If a is false and b is false then the output is “ELSE”.