Software Programming : Java Programming QUESTIONS AND ANSWERS :: part8 : 11 to 15
Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :
11.Which of the following language is Architecture-Neutral? |
Java |
C++ |
C |
Ada |
Pascal. |
12.Given the following definitions and reference declarations, which one of the following assignments is legal? //Definitions: interface I1{} interface I2{} class C1 implements I1 {} class C2 implements I2 {} class C3 extends C1 implements I2 {} //Reference declarations: //. . . . C1 obj1; C2 obj2; C3 obj3; //. . . . |
obj2 = obj1; |
obj3 = obj1; |
obj3 = obj2; |
I1 a = obj2; |
I1 b = obj3; |
13.Which of the following statements is true? #110. Which of the following statements is true? |
The subclass of a non-abstract class can be declared abstract |
All the members of the superclass are inherited by the subclass |
A final class can be abstract |
A class in which all the members are declared private, cannot be declared public |
In Java the extends clause is used to specify interface. |
14.What will be the result of attempting to compile and run the following program? public class Polymorphism { public static void main(String[] args) { A ref1 = new C(); B ref2 = (B) ref1; System.out.println(ref2.f()); } } class A { int f() { return 0; } } class B extends A { int f() { return 1; } } class C extends B { int f() { return 2; } } |
The program will fail to compile |
The program will compile without error, but will throw a ClassCastException when run |
The program will compile without error and print 0 when run |
The program will compile without error and print 1 when run |
The program will compile without error and print 2 when run. |
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