SCJP MOCK EXAM-01 MCQ Question

SCJP MOCK EXAM-01 MCQ Question
31. What is the result of attempting to compile and run the following
  • Compiler error
  • Runtime exception
  • Compiles and runs printing out 0
  • None of these
Show Answer
32. What is the result of trying to compile and run this
  • Compiles without error and runs printing out 1 twice
  • Compiles without error and runs printing out 0 followed by 1
  • Compiles without error and runs printing out 0 twice.
  • Runtime error
Show Answer
33. What is the result of trying to compile and run this?
  • The code will fail to compile
  • The code will run with no out put
  • This will run and print 0, 1 , 2 and "bye"
  • This will run and print 1 and "bye"
Show Answer
34. What is the result of trying to compile and run this?
  • Prints "Hello world" once
  • Prints "Hello world" twice
  • Compiler error
  • Runs without any output
Show Answer
35. What is the result of attempting to compile and run this.
  • The code will not compile.
  • It will run and print "Hello world" twice.
  • It will run and print "Hello world" once.
  • It will run and print "Hello world" thrice.
Show Answer
36. What will the output be ?
  • Prints - Default , A , B , C
  • Prints - A
  • Prints - B , C
  • Prints - A, B , C , Default
Show Answer
37. What will be printed out when this method runs ?
  • 64
  • 53
  • 76
  • 0
Show Answer
38. What will happen if you try to compile and run this?
  • It will fail to compile
  • Runtime error
  • Compiles and runs with no output.
  • Compiles and runs printing "Hello"
Show Answer
39. Which of the following are valid declarations?
  • int i= 0XCAFE;
  • boolean b = 0;
  • char c = 'A';
  • byte b = 128;
Show Answer
40. What is the result that will be printed out ?
  • 2
  • 0
  • 3
  • 2.5
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test