What is the answer and how the program work?

What is the answer and how the program work?

public class Threads2 implements Runnable { public void run() { System.out.println("run."); throw new RuntimeException("Problem"); } public static void main(String[] args) { Thread t = new Thread(new Threads2()); t.start(); System.out.println("End of method."); } } Which two can be results? (Choose two.) A. java.lang.RuntimeException: Problem B. run. java.lang.RuntimeException: Problem C. End of method. java.lang.RuntimeException: Problem D. End of method. run. java.lang.RuntimeException: Problem E. run. java.lang.RuntimeException: Problem End of method.

View Answers

July 14, 2012 at 10:31 PM

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.kota.core;

public class Exp1 implements Runnable { public void run() { System.out.println("run."); throw new RuntimeException("Problem"); } public static void main(String[] args) { Thread t = new Thread(new Exp1()); t.start(); System.out.println("End of method."); } } /*Which two can be results? (Choose two.) A. java.lang.RuntimeException: Problem B. run. java.lang.RuntimeException: Problem C. End of method. java.lang.RuntimeException: Problem D. End of method. run. java.lang.RuntimeException: Problem E. run. java.lang.RuntimeException: Problem End of method.

Output : Exception in thread "Thread-0" java.lang.RuntimeException: Problem at com.kesav.core.Exp1.run(Exp1.java:7) at java.lang.Thread.run(Unknown Source) run. */

The above is the out put of the program.

Ads









Related Tutorials/Questions & Answers:
What is the answer and how the program work?
how to get following answer in turbo c program
Advertisements
ModuleNotFoundError: No module named 'workq'
ModuleNotFoundError: No module named 'workq'
answer me this program
answer me this program
ModuleNotFoundError: No module named 'python-workq'
What is GPS Vehicle Tracking? How it Works?
what is wrong in this program......
what is wrong with this program
what is wrong in this program
how the answer is 13 can anyone explain plz
What is GPS and How It Works?
How Google News Works?
How does getcurrentsession() method works in hibernate sessionfactory?
what's the logic for create pattern program
What is the real use of Java Program
What is the real use of Java Program
what error in this program plese correct it
How GPS Tracking System Works
How Fleet management System works
ModuleNotFoundError: No module named 'answer'
ModuleNotFoundError: No module named 'answer'
ModuleNotFoundError: No module named 'answer'
c programming..what wil be the output of this program
what is ment by jdbc and how to connect with database?
How Jdbc program can be run??
How Struts 2 Framework works?
java.please answer this...
how to creat a new program
What is jQuery and how it is used?

Ads