
Software Programming : Java Programming QUESTIONS AND ANSWERS :: part7 : 11 to 15
Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :
11.Given the following source code, which comment line can be uncommented without introducing errors? abstract class MyClass { abstract void f(); final void g() {} // final void h() {} // (1) protected static int i; private int j; } final class MyOtherClass extends MyClass {// MyOtherClass(int n) { m = n; } //(2) public static void main(String[] args) { MyClass mc = new MyOtherClass(); } void f() { } void h() { } // void k() { i++; } // (3) // void l() { j++; } // (4) int m;} |
| (1) |
| (2) |
| (3) |
| (4) |
| None of the above. |
12.Which of the following is true? |
| If an exception is uncaught in a method, the method will terminate and normal execution will resume |
| An overriding method must declare that it throws the same exception classes as the method it overrides |
| The main() method of a program can declare that it throws checked exceptions |
| finally blocks are executed if, and only if, an exception gets throws while inside the corresponding try block |
| None of the above. |
13.What would be the result of attempting to compile and run the following program? class MyClass { static MyClass ref; String[] arguments; public static void main(String[] args) { ref = new MyClass(); ref.func(args); } public void func(String[] args) { ref.arguments = args; } } |
| The program will fail to compile, since the static method main() cannot have a call to the non-static method func() |
| The program will fail to compile, since the non-static method func() cannot access the static variable ref |
| The program will fail to compile, since the argument args passed to the static method main() cannot be passed on to the non-static method func() |
| The program will compile, but will throw an exception when run |
| The program will compile and run successfully. |
More Java Programming QUESTIONS AND ANSWERS available in next pages
-
Health is the greatest gift, contentment is the greatest wealth -Buddha
- TNTET 2021 - Practice
- SSC CGL 2021 - Practice
- TNPSC Group 2A 2021 - Practice
- IIT JEE
- IIT JEE Q&A
- TNPSC Answer Keys
- TNPSC Group 2 Syllabus
-
TNPSC Q&A

- Online Tests - TNPSC
- Online Tests - GK
- IBPS 2020-2021
- Online Tests - Bank
- Online Tests - RRB NTPC
- Online Tests - UGC NET
- Online Tests - TANCET
- Online Aptitude Test
-
Engineering

-
Programming

-
Basic Science

-
Quiz

- Plus Two Question Papers
- SSLC Question Bank
-
Aptitude Tests

-
Logical Reasoning

-
General Knowledge-Hindi

-
Indian History MCQ

-
Indian Geography MCQ

-
Indian Civics MCQ

-
Indian Economics MCQ

-
CTET Biology MCQ

-
CTET Chemistry MCQ

-
CTET Physics Solved MCQ

-
Arithmetic Tests

- Press Release
- FAQ
- Coaching Centres
- TNPSC Group 1 Syllabus
-
TNPSC Group IV Syllabus

- TRB 2017 in English PDF

- TRB 2017 in Tamil PDF

- TET
- TNTET
