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.
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
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";
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
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
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