Software Programming : Java Programming QUESTIONS AND ANSWERS :: part13 : 6 to 10
Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :
6.Analyze the following code: public class Test { public static void main(String[] args) { String s = new String("Welcome to Java"); Object o = s; String d = (String)o; } } |
When assigning s to o in Object o = s, a new object is created |
When casting o to s in String d = (String)o, a new object is created |
When casting o to s in String d = (String)o, the contents of o is changed |
s, o, and d reference the same String object |
s,o,and d doesnot reference the same String object. |
7.The code causes Java to throw int number = Integer.MAX_VALUE + 1; |
RuntimeException |
Exception |
Error |
Throwable. |
No exceptions. |
8.Which of the following method is a static in java.lang.Thread? |
run() |
sleep(long) |
start() |
join() |
setPriority(int). |
9.After Analyzing the following code, which statement is appropriate? class Test { public static void main(String[] args) throws MyException { System.out.println("Welcome to Java"); } } class MyException extends Error { } |
You should not declare a class that extends Error, because Error raises a fatal error that terminates the program |
You cannot declare an exception in the main method |
You declared an exception in the main method, but you did not throw it |
The program has a compilation error |
You can declare a class that extends error. |
10.Every event object has the ________ method. #201. Every event object has the ________ method. |
getSource() |
getActionCommand() |
getTimeStamp() |
getWhen() |
getKeyChar(). |
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