SCJP MOCK EXAM-01 MCQ Question

SCJP MOCK EXAM-01 MCQ Question
21. local variables which are declared inside a method ALWAYS:
  • initialized automatically to their default values
  • members are need to initializ explicitly.
Show Answer
22. Select the true statements.
  • Transient methods cannot be overridden
  • A final class may not be subclassed.
  • A private method can never be overridden to become public
  • An abstract class may contain final methods
Show Answer
23. Which of the following are valid for declaring and intialising a char variable?
  • char c = 'a';
  • char c = '\'';
  • char c = '\n';
  • char c = "a";
Show Answer
24. What will happen if the main function will declared as:
  • It will compile and run successfully.
  • It will not compile
  • It will compile but the program will throw exception at runtime saying there is no main method.
  • None of these
Show Answer
25. what will be the output
  • 5 7
  • 5 8
  • 6 8
  • 6 7
Show Answer
26. what will be the output
  • 120
  • 50 70
  • error
  • 3500
Show Answer
27. What is the result of attempting to compile and run this
  • The code will not compile.
  • Runtime exception
  • Compiles and runs printing out
  • None of these
Show Answer
28. Is this code legal ?
  • TRUE
  • FALSE
Show Answer
29. Is this legal
  • TRUE
  • FALSE
Show Answer
30. What is the result of attempting to compile and run this code
  • The code will compile and run printing out value = 1
  • The code will compile and run printing out value = 0
  • The code will fail to compile because i has not been initialised
  • Run time error
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test