Software Programming : Java Programming QUESTIONS AND ANSWERS :: part1 : 1 to 5
Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :
1.Which of the following is not true? |
An interface can extend another interface. |
A class which is implementing an interface must implement all the methods of the interface. |
An interface can implement another interface. |
An interface is a solution for multiple inheritance in java. |
None of the above. |
2.Which statement is not true in java language? |
A public member of a class can be accessed in all the packages. |
A private member of a class cannot be accessed by the methods of the same class. |
A private member of a class cannot be accessed from its derived class. |
A protected member of a class can be accessed from its derived class. |
None of the above. |
3.Consider the following code fragment Rectangle r1 = new Rectangle(); r1.setColor(Color.blue); Rectangle r2 = r1; r2.setColor(Color.red); After the above piece of code is executed, what are the colors of r1 and r2 (in this order)? |
Color.blue |
.red |
Color.blue |
.blue |
Color.red |
4.Consider the two methods (within the same class) public static int foo(int a, String s) { s = "Yellow"; a=a+2; return a; } public static void bar() { int a=3; String s = "Blue"; a = foo(a,s); System.out.println("a="+a+" s="+s); } public static void main(String args[]) { bar(); } What is printed on execution of these methods? |
a = 3 s = Blue |
a = 5 s = Yellow |
a = 3 s = Yellow |
a = 5 s = Blue |
none of the above. |
5.What is the type and value of the following expression? (Notice the integer division) -4 + 1/2 + 2*-3 + 5.0 |
int -5 |
double -4.5 |
int -4 |
double -5.0 |
None of the above. |
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