Bissoy.com
Login
Doctors
Medicines
MCQs
Q&A
Ask
Merit Test
Questions
Courses
Given the code. What will be the result public class Test implements Runnable{ public static void main(String[] args) throws InterruptedException{ Thread a = new Thread(new Test()); a.start(); System.out.print("Begin"); a.join(); System.out.print("End"); } public void run(){ System.out.print("Run"); } }?
Compilation fails.
An exception is thrown at runtime.
"BeginRunEnd" is printed.
"BeginEndRun" is printed.
"BeginEnd" is printed.
LohaHridoy
0
Edit
9
views
2025-01-04 04:42
1
Answers
AhmedNazir
Answer: Option 3
Let'
0
Thanks
9
views
Answered
2022-09-01 13:21
Report
Edit
Call
Related Questions
what is the result of the following piece of code: public class Person{ public void talk(){ System.out.print("I am a Person"); } } public class Student extends Person{ public void talk(){ System.out.print("I am a Student"); } } public class Test{ public static void main(String args[]){ Person p = new Student(); p.talk(); } }?
1 Answers
7
Views
What is the result of compiling and running the following code class Base{ public Base(){ System.out.print("Base"); } } public class Derived extends Base{ public Derived(){ this("Examveda"); System.out.print("Derived"); } public Derived(String s){ System.out.print(s); } public static void main(String[] args){ new Derived(); } }?
1 Answers
30
Views
What is the output for the below code import java.io.FileNotFoundException; class A{ public void printName() throws FileNotFoundException{ System.out.println("Value-A"); } } class B extends A{ public void printName() throws NullPointerException{ System.out.println("Name-B"); } } public class Test{ public static void main (String[] args) throws Exception{ A a = new B(); a.printName(); } }?
1 Answers
6
Views
What will be the output when the following program is compiled and executed abstract class TestAbstract{ String my_name; String myName(){ my_name = "Examveda"; return my_name; } abstract void display(); } public class Test extends TestAbstract{ void display(){ String n = myName(); System.out.print("My name is "+ n); } public static void main(String args[]){ Test t = new Test(); t.display(); } }?
1 Answers
6
Views
What will be the output interface A{ public void method(); } class One{ public void method(){ System.out.println("Class One method"); } } class Two extends One implements A{ public void method(){ System.out.println("Class Two method"); } } public class Test extends Two{ public static void main(String[] args){ A a = new Two(); a.method(); } }?
1 Answers
13
Views
What will be the result of compiling and executing the following program code class Vehicle{ public void printSound(){ System.out.print("vehicle"); } } class Car extends Vehicle{ public void printSound(){ System.out.print("car"); } } class Bike extends Vehicle{ public void printSound(){ System.out.print("bike"); } } public class Test{ public static void main(String[] args){ Vehicle v = new Car(); Bike b = (Bike) v; v.printSound(); b.printSound(); } }?
1 Answers
6
Views
What will be the result after the class Test execution class A{ public void doA(){ B b = new B(); b.dobB(); System.out.print("doA"); } } class B{ public void dobB(){ C c = new C(); c.doC(); System.out.print("doB"); } } class C{ public void doC(){ if(true) throw new NullPointerException(); System.out.print("doC"); } } public class Test{ public static void main(String args[]){ try{ A a = new A(); a.doA(); }catch(Exception ex){ System.out.print("error"); } } }?
1 Answers
9
Views
What will be the output of the following program code public class Test implements Runnable{ public static void main(String[] args){ Thread t = new Thread(this); t.start(); } public void run(){ System.out.println("test"); } }?
1 Answers
150
Views
What will be the output after compiling and executing the following code public class Test implements Runnable{ public static void main(String[] args) throws InterruptedException{ Thread a = new Thread(new Test()); a.start(); System.out.print("Begin"); a.join(); System.out.print("End"); } public void run(){ System.out.print("Run"); } }?
1 Answers
10
Views
What will be output of the following program code public class Test implements Runnable{ public void run(){ System.out.print("go"); } public static void main(String arg[]) { Thread t = new Thread(new Test()); t.run(); t.run(); t.start(); } }?
1 Answers
18
Views
কোরআন
হাদিস
চাকুরি প্রস্তুতি
বিশ্ববিদ্যালয় ভর্তি
মেডিকেল SBA
12
এইচএসসি
10
এসএসসি
8
জেএসসি
এক্সাম দিয়ে মেধা যাচাই করুন
Job Preparation (1125)
Admission (754)
এসএসসি (10)
এইচএসসি (5)
Login Required
You need to log in to continue.
Login
Cancel
Download Required
You need to download the app to make a call.
Download
Cancel