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.









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'
ModuleNotFoundError: No module named 'python-workq'
answer me this program
answer me this program
What is GPS Vehicle Tracking? How it Works?
How TCP/IP 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?
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 Google News Works?
How does getcurrentsession() method works in hibernate sessionfactory?
how to make this java mail works? - Java Beginners
How GPS Tracking System Works
c programming..what wil be the output of this program
ModuleNotFoundError: No module named 'answer'
ModuleNotFoundError: No module named 'answer'
ModuleNotFoundError: No module named 'answer'
java.please answer this...
How Fleet management System works
How Struts 2 Framework works?
what is ment by jdbc and how to connect with database?
How Jdbc program can be run??
answer it soon
com.mobilesolutionworks - works-widget version 1.0.4 Maven dependency. How to use works-widget version 1.0.4 in pom.xml?
What is jQuery and how it is used?
What is jQuery and how it is used?
how to creat a new program
Bubble Sort Program in Java
answer
how to run this program?
how to run rmi program
How to write Java Program
VoIP Works
How Voice over Internet Protocol (VoIP) Works
how to make a program on array
how to write this program
ModuleNotFoundError: No module named 'aws-works'
ModuleNotFoundError: No module named 'aws-works'
ModuleNotFoundError: No module named 'aws-works'
how to connect program to database
how to run java program

Ads