SCJP MOCK EXAM-01 MCQ Question Questions and Answers

Practice Mode
Showing 10 of 41 questions
Q21
local variables which are declared inside a method ALWAYS:
  • A initialized automatically to their default values
  • B members are need to initializ explicitly.
Answer: Option B
Q22
Select the true statements.
  • A Transient methods cannot be overridden
  • B A final class may not be subclassed.
  • C A private method can never be overridden to become public
  • D An abstract class may contain final methods
Answer: Option
Q23
Which of the following are valid for declaring and intialising a char variable?
  • A char c = 'a';
  • B char c = '\'';
  • C char c = '\n';
  • D char c = "a";
Answer: Option
Q24
What will happen if the main function will declared as:
  • A It will compile and run successfully.
  • B It will not compile
  • C It will compile but the program will throw exception at runtime saying there is no main method.
  • D None of these
Answer: Option C
Q25
what will be the output
  • A 5 7
  • B 5 8
  • C 6 8
  • D 6 7
Answer: Option
Q26
what will be the output
  • A 120
  • B 50 70
  • C error
  • D 3500
Answer: Option C
Q27
What is the result of attempting to compile and run this
  • A The code will not compile.
  • B Runtime exception
  • C Compiles and runs printing out
  • D None of these
Answer: Option A
Q28
Is this code legal ?
  • A TRUE
  • B FALSE
Answer: Option B
Q29
Is this legal
  • A TRUE
  • B FALSE
Answer: Option A
Q30
What is the result of attempting to compile and run this code
  • A The code will compile and run printing out value = 1
  • B The code will compile and run printing out value = 0
  • C The code will fail to compile because i has not been initialised
  • D Run time error
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test