SCJP MOCK EXAM-01 MCQ Question Questions and Answers

Practice Mode
Showing 10 of 41 questions
Q31
What is the result of attempting to compile and run the following
  • A Compiler error
  • B Runtime exception
  • C Compiles and runs printing out 0
  • D None of these
Answer: Option C
Q32
What is the result of trying to compile and run this
  • A Compiles without error and runs printing out 1 twice
  • B Compiles without error and runs printing out 0 followed by 1
  • C Compiles without error and runs printing out 0 twice.
  • D Runtime error
Answer: Option
Q33
What is the result of trying to compile and run this?
  • A The code will fail to compile
  • B The code will run with no out put
  • C This will run and print 0, 1 , 2 and "bye"
  • D This will run and print 1 and "bye"
Answer: Option A
Q34
What is the result of trying to compile and run this?
  • A Prints "Hello world" once
  • B Prints "Hello world" twice
  • C Compiler error
  • D Runs without any output
Answer: Option C
Q35
What is the result of attempting to compile and run this.
  • A The code will not compile.
  • B It will run and print "Hello world" twice.
  • C It will run and print "Hello world" once.
  • D It will run and print "Hello world" thrice.
Answer: Option A
Q36
What will the output be ?
  • A Prints - Default , A , B , C
  • B Prints - A
  • C Prints - B , C
  • D Prints - A, B , C , Default
Answer: Option C
Q37
What will be printed out when this method runs ?
  • A 64
  • B 53
  • C 76
  • D 0
Answer: Option D
Q38
What will happen if you try to compile and run this?
  • A It will fail to compile
  • B Runtime error
  • C Compiles and runs with no output.
  • D Compiles and runs printing "Hello"
Answer: Option D
Q39
Which of the following are valid declarations?
  • A int i= 0XCAFE;
  • B boolean b = 0;
  • C char c = 'A';
  • D byte b = 128;
Answer: Option
Q40
What is the result that will be printed out ?
  • A 2
  • B 0
  • C 3
  • D 2.5
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test