Ayush Java 4
Ayush Java 4
EN No :- E21110403000110108
int hh,mm,ss;
try
for(hh=0;hh<24;hh++)
for(mm=0;mm<=59;mm++)
for(ss=0;ss<=59;ss++)
System.out.println(hh+":"+mm+":"+ss);
t.sleep(1000);
}
PAGE NO:-2 SUB:-JAVA PREP BY:-RAMANI
AYUSH
Vidhyadeep insti. Of com. & info. Technology, anita (kim)
catch(Exception e)
System.out.println("Error:" + e);
OUTPUT:-
implement()
t.start();
try {
for(int i=5;i>0;i--)
Thread.sleep(500);
catch(InterruptedException e)
System.out.println("Child Interrupted");
};
class drdemo
try
for(int i=5;i>0;i--)
Thread.sleep(1000);
catch(InterruptedException e)
System.out.println("Main Interrupted");
};
OUTPUT:-
implement()
super();
this.start();
try {
PAGE NO:-5 SUB:-JAVA PREP BY:-RAMANI
AYUSH
Vidhyadeep insti. Of com. & info. Technology, anita (kim)
for(int i=5;i>0;i--)
Thread.sleep(500);
catch(InterruptedException e)
System.out.println("Child Interrupted");
};
class drdemo
try
for(int i=5;i>0;i--)
Thread.sleep(1000);
catch(InterruptedException e)
System.out.println("Main Interrupted");
};
OUTPUT:-
4) MULTI THREDING
public class Main {
new TestThread("TestThread1");
new TestThread("TestThread2");
new TestThread("TestThread3");
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
OUTPUT:-
System.out.println(e.getName());
return null;
OUTPUT:-
System.out.println("Hello World");
OUTPUT:-
7) HEREACHOIY OF PACKAGE
class P {
int parentVariable = 5;
class C1 extends P {
int childVariable = 1;
PAGE NO:-9 SUB:-JAVA PREP BY:-RAMANI
AYUSH
Vidhyadeep insti. Of com. & info. Technology, anita (kim)
class C2 extends P {
int childVariable = 2;
class C3 extends P {
int childVariable = 3;
class main {
OUTPUT:-