BY KOMAKULA RAMESH
Week :..1.....CALCULATOR PROGRAM:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class calci extends JFrame implements ActionListener
{
JLabel l1,l2,l3;
JTextField t1,t2,t3;
JButton b1,b2,b3,b4,b5,b6;
calci()
{
Container c=getContentPane();
GridLayout grid=new GridLayout(6,4,0,0);
c.setLayout(grid);
l1=new JLabel("FIRST NO:");
add(l1);
t1=new JTextField(15);
add(t1);
l2=new JLabel("SECOND NO:");
add(l2);
t2=new JTextField(15);
add(t2);
l3=new JLabel("RESULT:");
add(l3);
t3=new JTextField(15);
add(t3);
b1=new JButton("ADD");
add(b1);
b1.addActionListener(this);
b2=new JButton("SUB");
add(b2);
b2.addActionListener(this);
b3=new JButton("MUL");
add(b3);
b3.addActionListener(this);
b4=new JButton("DIV");
add(b4);
b4.addActionListener(this);
b5=new JButton("MOD");
add(b5);
b5.addActionListener(this);
b6=new JButton("CLEAR");
add(b6);
b6.addActionListener(this);
c.add(l1);
c.add(t1);
c.add(l2);
c.add(t2);
c.add(l3);
c.add(t3);
c.add(b1);
c.add(b2);
c.add(b3);
c.add(b4);
c.add(b5);
c.add(b6);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==b1)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double Sum=x+y;
t3.setText(""+Sum);
}
if(ae.getSource()==b2)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double Sub=x-y;
t3.setText(""+Sub);
}
if(ae.getSource()==b3)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double mul=x*y;
t3.setText(""+mul);
}
if(ae.getSource()==b4)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double div=x/y;
t3.setText(""+div);
}
if(ae.getSource()==b5)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double rem=x%y;
t3.setText(""+rem);
}
if(ae.getSource()==b6)
{
t1.setText("");
t2.setText("");
t3.setText("");
}
}
public static void main(String args[])
{
calci calc=new calci();
calc.setSize(200,200);
calc.setVisible(true);
}
}
OUTPUT:
Week :....3...Develop an applet in Java that receives an integer in one text field, and computes its factorial value
and returns it in another text field, when the utto a ed Co pute is li ked.
PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
/*<applet code=".class" height=100 width=500></applet>*/
public class Af extends Applet implements ActionListener
{
TextField tf1;
TextField tf2;
Button b;
Label l;
public void init()
{
l=new Label("Enter the number & press the button");
tf1=new TextField("",5);
tf2=new TextField("",10);
b=new Button("compute");
add(l);
add(tf1);
add(tf2);
add(b);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str=ae.getActionCommand();
String str1;
int fact=1;
if(str=="compute")
int n=Integer.parseInt(tf1.getText());
for(int i=1;i<=n;i++)
fact=fact*i;
str1=""+fact;
tf2.setText(str1);
}
}
}
EXECUTION:
C:\>javac af.java
C:\>appletviewer af.html
OUTPUT:
Week :.......Write a java program to create an absract class named Shape that contains two integers and
an empty method named PrintArea().Provide three classesnamed Rectangle,Triangle,Circle such
thatbeach one of the classes extebds the class Shape.Each one of the classes contains onlt the method
ptintArea() that prints the area of the given Shape.
PROGRAM:
import java.io.*;
import java.util.*;
abstract class Shape
{
int x=20,y=10;
abstract void printArea();
}
class Rectangle extends Shape
{
void printArea()
{
System.out.println(super.x*super.y);
}
}
class Triangle extends Shape
{
void printArea()
{
System.out.println(0.5*super.x*super.x);
}
}
class Circle extends Shape
{
void printArea()
{
System.out.println(3.1416*super.x*super.x);
}
}
class Test1
{
public static void main(String a[ ]) throws IOException
{
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the number");
String h=bf.readLine();
int ch=Integer.parseInt(h);
switch(ch)
{
case 1:
Rectangle e1=new Rectangle();
e1.printArea();
break;
case 2:
Triangle e2=new Triangle();
e2.printArea();
break;
case 3:
Circle e3=new Circle();
e3.printArea();
break;
default: System.out.println("Exited");
}
}}
OUTPUT:
----Week :.......TRAFFIC SIGNAL
PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="TrafficSign.class" width=300 height=500>
</applet>*/
public class TrafficSign extends Applet implements ItemListener
{
CheckboxGroup cbg=new CheckboxGroup();
public void init()
{
Checkbox red,yellow,green;
red=new Checkbox("red",cbg,false);
yellow=new Checkbox("yellow",cbg,false);
green=new Checkbox("green",cbg,false);
add(red);
add(yellow);
add(green);
red.addItemListener(this);
yellow.addItemListener(this);
green.addItemListener(this);
}
public void update(Graphics g)
{
String msg=cbg.getSelectedCheckbox().getLabel();
String s1="red",s2="yellow",s3="green";
if(msg.equals(s1))
{
g.setColor(Color.red);
g.fillOval(100,120,80,80);
g.setColor(Color.white);
g.fillOval(100,240,80,80);
g.setColor(Color.white);
g.fillOval(100,360,80,80);
g.drawString(" Please Stop",100,100);
}
else if(msg.equals(s2))
{
g.setColor(Color.white);
g.fillOval(100,120,80,80);
g.setColor(Color.yellow);
g.fillOval(100,240,80,80);
g.setColor(Color.white);
g.fillOval(100,360,80,80);
g.drawString("Please Wait",100,230);
}
else if(msg.equals(s3))
{
g.setColor(Color.white);
g.fillOval(100,120,80,80);
g.setColor(Color.white);
g.fillOval(100,240,80,80);
g.setColor(Color.green);
g.fillOval(100,360,80,80);
g.drawString("Please GO GO.....",100,350);
}
}
public void paint(Graphics g)
{
g.drawRect(90,80,100,400);
g.fillRect(90,80,100,400);
g.setColor(Color.white);
g.drawOval(100,120,80,80);
g.fillOval(100,120,80,80);
g.drawOval(100,240,80,80);
g.fillOval(100,240,80,80);
g.drawOval(100,360,80,80);
g.fillOval(100,360,80,80);
g.drawString("Please GO...",200,200);
update(g);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
}
EXECUTION:
C:/>javac TrafficSign.java
C:/>Appletviewer Trafficsign.java
OUTPUT:
Week :.......DIVIDE PROGRM WITH EXECEPTIONS
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Lab19 extends JFrame implements ActionListener
{
private TextField tf1,tf2,tf3;
private Button div;
public static void main(String args[])
{
Lab19 f=new Lab19();
f.setSize(450,500);
f.setVisible(true);
}
public Lab19()
{
setTitle("Test");
setBackground(Color.yellow);
setForeground(Color.red);
Panel p1=new Panel();
p1.setLayout(new FlowLayout());
p1.add(new Label("Number1"));
p1.add(tf1=new TextField("",3));
p1.add(new Label("Number2"));
p1.add(tf2=new TextField("",3));
p1.add(new Label("RESULT"));
p1.add(tf3=new TextField("",3));
tf3.setEditable(false);
Panel p2=new Panel();
p2.setLayout(new FlowLayout());
p2.add(div=new Button("Divide"));
setLayout(new BorderLayout(30,40));
add("Center",p1);
add("South",p2);
div.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==div)
{
int num1=(Integer.parseInt(tf1.getText().trim()));
int num2=(Integer.parseInt(tf2.getText().trim()));
int num3=0;
try
{
num3=num1/num2;
tf3.setText(String.valueOf(num3));
}
catch(RuntimeException aex)
{
JOptionPane.showMessageDialog(null,aex.getMessage());
}
}
}
}
OUTPUT:
PERFECT EXECUTION:
ARITHMETIC EXECEPTIONPERFECT EXECUTION:
NUMBER FORMAT EXECEPTION:
Week :.......SIMPLE MESSAGE IN APPLET:
import java.awt.*;
import java.applet.*;
/*<applet code="simple.class" width=600 height=500>
</applet>*/
public class simple extends Applet
{
public void init()
{
setBackground(Color.yellow);
}
public void paint(Graphics g)
{
g.drawString("Welcome To Applet",20,20);
g.drawString("This Is Komakula Ramesh",50,50);
}
}
OUTPUT:
Week :.......MOUSE HANDLING:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/* <applet code="Lab16.class" height=500 width=500>
</applet>*/
public class Lab16 extends Applet implements MouseListener,MouseMotionListener
{
String msg;
int mouseX,mouseY;
public void init()
{
addMouseListener(this);
addMouseMotionListener(this);
msg=" ";
mouseX=0;
mouseY=0;
}
public void mouseEntered(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseEntered";
showStatus("Mouse Entered at "+mouseX+","+mouseY);
repaint();
}
public void mousePressed(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MousePressed";
showStatus("Mouse Pressed at"+mouseX+","+mouseY);
repaint();
}
public void mouseReleased(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseReleased";
showStatus("MouseReleased at"+mouseX+","+mouseY);
repaint();
}
public void mouseDragged(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseDragging";
showStatus("MouseDragging at"+mouseX+","+mouseY);
repaint();
}
public void mouseMoved(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MovingMouse";
showStatus("MovingMouse at"+me.getX()+","+me.getY());
repaint();
}
public void mouseClicked(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseClicked";
showStatus("MouseClicked at"+me.getX()+","+me.getY());
repaint();
}
public void mouseExited(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseExited";
showStatus("MouseClicked at"+me.getX()+","+me.getY());
repaint();
}
public void paint(Graphics g)
{
g.drawString(msg,mouseX,mouseY);
}
}
OUTPUT:
Week :.......Write a java program that implements a multi-thread application that has three threads.First
thread generates random integer every 1 second and if the value is even,second thread computes the square
of the number and prints.if the value is odd,the third thread will print the value of cube of the number.
import java.lang.*;
import java.util.*;
class Second extends Thread
{
int e;
public void run()
System.out.println(e*e);
{
}
Second(int j)
{
e=j;
}
}
class third extends Thread
{
int w;
public void run()
{
System.out.println(w*w*w);
}
third(int z)
{
w=z;
}
}
class first extends Thread
{
public void run()
{
for(int i=1;i<3;i++)
{
Random r=new Random();
int y=r.nextInt(1000);
System.out.println(y);
if(y%2==0)
{
Second s=new Second(y);
s.start();
try
{
sleep(1000);
}
catch(InterruptedException e)
{
}
}
}
try
{
sleep(1000);
}
catch(InterruptedException e)
{
}
}
}
public class dext
{
public static void main(String args[])
{
first fr=new first();
fr.start();
}
}
OUTPUT:
-----------------BY KOMAKULA RAMESH
Week :..1.....CALCULATOR PROGRAM:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class calci extends JFrame implements ActionListener
{
JLabel l1,l2,l3;
JTextField t1,t2,t3;
JButton b1,b2,b3,b4,b5,b6;
calci()
{
Container c=getContentPane();
GridLayout grid=new GridLayout(6,4,0,0);
c.setLayout(grid);
l1=new JLabel("FIRST NO:");
add(l1);
t1=new JTextField(15);
add(t1);
l2=new JLabel("SECOND NO:");
add(l2);
t2=new JTextField(15);
add(t2);
l3=new JLabel("RESULT:");
add(l3);
t3=new JTextField(15);
add(t3);
b1=new JButton("ADD");
add(b1);
b1.addActionListener(this);
b2=new JButton("SUB");
add(b2);
b2.addActionListener(this);
b3=new JButton("MUL");
add(b3);
b3.addActionListener(this);
b4=new JButton("DIV");
add(b4);
b4.addActionListener(this);
b5=new JButton("MOD");
add(b5);
b5.addActionListener(this);
b6=new JButton("CLEAR");
add(b6);
b6.addActionListener(this);
c.add(l1);
c.add(t1);
c.add(l2);
c.add(t2);
c.add(l3);
c.add(t3);
c.add(b1);
c.add(b2);
c.add(b3);
c.add(b4);
c.add(b5);
c.add(b6);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==b1)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double Sum=x+y;
t3.setText(""+Sum);
}
if(ae.getSource()==b2)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double Sub=x-y;
t3.setText(""+Sub);
}
if(ae.getSource()==b3)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double mul=x*y;
t3.setText(""+mul);
}
if(ae.getSource()==b4)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double div=x/y;
t3.setText(""+div);
}
if(ae.getSource()==b5)
{
double x=Double.parseDouble(t1.getText());
double y=Double.parseDouble(t2.getText());
double rem=x%y;
t3.setText(""+rem);
}
if(ae.getSource()==b6)
{
t1.setText("");
t2.setText("");
t3.setText("");
}
}
public static void main(String args[])
{
calci calc=new calci();
calc.setSize(200,200);
calc.setVisible(true);
}
}
OUTPUT:
Week :....3...Develop an applet in Java that receives an integer in one text field, and computes its factorial value
and returns it in another text field, when the utto a ed Co pute is li ked.
PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
/*<applet code=".class" height=100 width=500></applet>*/
public class Af extends Applet implements ActionListener
{
TextField tf1;
TextField tf2;
Button b;
Label l;
public void init()
{
l=new Label("Enter the number & press the button");
tf1=new TextField("",5);
tf2=new TextField("",10);
b=new Button("compute");
add(l);
add(tf1);
add(tf2);
add(b);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String str=ae.getActionCommand();
String str1;
int fact=1;
if(str=="compute")
int n=Integer.parseInt(tf1.getText());
for(int i=1;i<=n;i++)
fact=fact*i;
str1=""+fact;
tf2.setText(str1);
}
}
}
EXECUTION:
C:\>javac af.java
C:\>appletviewer af.html
OUTPUT:
Week :.......Write a java program to create an absract class named Shape that contains two integers and
an empty method named PrintArea().Provide three classesnamed Rectangle,Triangle,Circle such
thatbeach one of the classes extebds the class Shape.Each one of the classes contains onlt the method
ptintArea() that prints the area of the given Shape.
PROGRAM:
import java.io.*;
import java.util.*;
abstract class Shape
{
int x=20,y=10;
abstract void printArea();
}
class Rectangle extends Shape
{
void printArea()
{
System.out.println(super.x*super.y);
}
}
class Triangle extends Shape
{
void printArea()
{
System.out.println(0.5*super.x*super.x);
}
}
class Circle extends Shape
{
void printArea()
{
System.out.println(3.1416*super.x*super.x);
}
}
class Test1
{
public static void main(String a[ ]) throws IOException
{
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the number");
String h=bf.readLine();
int ch=Integer.parseInt(h);
switch(ch)
{
case 1:
Rectangle e1=new Rectangle();
e1.printArea();
break;
case 2:
Triangle e2=new Triangle();
e2.printArea();
break;
case 3:
Circle e3=new Circle();
e3.printArea();
break;
default: System.out.println("Exited");
}
}}
OUTPUT:
----Week :.......TRAFFIC SIGNAL
PROGRAM:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*<applet code="TrafficSign.class" width=300 height=500>
</applet>*/
public class TrafficSign extends Applet implements ItemListener
{
CheckboxGroup cbg=new CheckboxGroup();
public void init()
{
Checkbox red,yellow,green;
red=new Checkbox("red",cbg,false);
yellow=new Checkbox("yellow",cbg,false);
green=new Checkbox("green",cbg,false);
add(red);
add(yellow);
add(green);
red.addItemListener(this);
yellow.addItemListener(this);
green.addItemListener(this);
}
public void update(Graphics g)
{
String msg=cbg.getSelectedCheckbox().getLabel();
String s1="red",s2="yellow",s3="green";
if(msg.equals(s1))
{
g.setColor(Color.red);
g.fillOval(100,120,80,80);
g.setColor(Color.white);
g.fillOval(100,240,80,80);
g.setColor(Color.white);
g.fillOval(100,360,80,80);
g.drawString(" Please Stop",100,100);
}
else if(msg.equals(s2))
{
g.setColor(Color.white);
g.fillOval(100,120,80,80);
g.setColor(Color.yellow);
g.fillOval(100,240,80,80);
g.setColor(Color.white);
g.fillOval(100,360,80,80);
g.drawString("Please Wait",100,230);
}
else if(msg.equals(s3))
{
g.setColor(Color.white);
g.fillOval(100,120,80,80);
g.setColor(Color.white);
g.fillOval(100,240,80,80);
g.setColor(Color.green);
g.fillOval(100,360,80,80);
g.drawString("Please GO GO.....",100,350);
}
}
public void paint(Graphics g)
{
g.drawRect(90,80,100,400);
g.fillRect(90,80,100,400);
g.setColor(Color.white);
g.drawOval(100,120,80,80);
g.fillOval(100,120,80,80);
g.drawOval(100,240,80,80);
g.fillOval(100,240,80,80);
g.drawOval(100,360,80,80);
g.fillOval(100,360,80,80);
g.drawString("Please GO...",200,200);
update(g);
}
public void itemStateChanged(ItemEvent ie)
{
repaint();
}
}
EXECUTION:
C:/>javac TrafficSign.java
C:/>Appletviewer Trafficsign.java
OUTPUT:
Week :.......DIVIDE PROGRM WITH EXECEPTIONS
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Lab19 extends JFrame implements ActionListener
{
private TextField tf1,tf2,tf3;
private Button div;
public static void main(String args[])
{
Lab19 f=new Lab19();
f.setSize(450,500);
f.setVisible(true);
}
public Lab19()
{
setTitle("Test");
setBackground(Color.yellow);
setForeground(Color.red);
Panel p1=new Panel();
p1.setLayout(new FlowLayout());
p1.add(new Label("Number1"));
p1.add(tf1=new TextField("",3));
p1.add(new Label("Number2"));
p1.add(tf2=new TextField("",3));
p1.add(new Label("RESULT"));
p1.add(tf3=new TextField("",3));
tf3.setEditable(false);
Panel p2=new Panel();
p2.setLayout(new FlowLayout());
p2.add(div=new Button("Divide"));
setLayout(new BorderLayout(30,40));
add("Center",p1);
add("South",p2);
div.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==div)
{
int num1=(Integer.parseInt(tf1.getText().trim()));
int num2=(Integer.parseInt(tf2.getText().trim()));
int num3=0;
try
{
num3=num1/num2;
tf3.setText(String.valueOf(num3));
}
catch(RuntimeException aex)
{
JOptionPane.showMessageDialog(null,aex.getMessage());
}
}
}
}
OUTPUT:
PERFECT EXECUTION:
ARITHMETIC EXECEPTIONPERFECT EXECUTION:
NUMBER FORMAT EXECEPTION:
Week :.......SIMPLE MESSAGE IN APPLET:
import java.awt.*;
import java.applet.*;
/*<applet code="simple.class" width=600 height=500>
</applet>*/
public class simple extends Applet
{
public void init()
{
setBackground(Color.yellow);
}
public void paint(Graphics g)
{
g.drawString("Welcome To Applet",20,20);
g.drawString("This Is Komakula Ramesh",50,50);
}
}
OUTPUT:
Week :.......MOUSE HANDLING:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/* <applet code="Lab16.class" height=500 width=500>
</applet>*/
public class Lab16 extends Applet implements MouseListener,MouseMotionListener
{
String msg;
int mouseX,mouseY;
public void init()
{
addMouseListener(this);
addMouseMotionListener(this);
msg=" ";
mouseX=0;
mouseY=0;
}
public void mouseEntered(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseEntered";
showStatus("Mouse Entered at "+mouseX+","+mouseY);
repaint();
}
public void mousePressed(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MousePressed";
showStatus("Mouse Pressed at"+mouseX+","+mouseY);
repaint();
}
public void mouseReleased(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseReleased";
showStatus("MouseReleased at"+mouseX+","+mouseY);
repaint();
}
public void mouseDragged(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseDragging";
showStatus("MouseDragging at"+mouseX+","+mouseY);
repaint();
}
public void mouseMoved(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MovingMouse";
showStatus("MovingMouse at"+me.getX()+","+me.getY());
repaint();
}
public void mouseClicked(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseClicked";
showStatus("MouseClicked at"+me.getX()+","+me.getY());
repaint();
}
public void mouseExited(MouseEvent me)
{
mouseX=me.getX();
mouseY=me.getY();
msg="MouseExited";
showStatus("MouseClicked at"+me.getX()+","+me.getY());
repaint();
}
public void paint(Graphics g)
{
g.drawString(msg,mouseX,mouseY);
}
}
OUTPUT:
Week :.......Write a java program that implements a multi-thread application that has three threads.First
thread generates random integer every 1 second and if the value is even,second thread computes the square
of the number and prints.if the value is odd,the third thread will print the value of cube of the number.
import java.lang.*;
import java.util.*;
class Second extends Thread
{
int e;
public void run()
System.out.println(e*e);
{
}
Second(int j)
{
e=j;
}
}
class third extends Thread
{
int w;
public void run()
{
System.out.println(w*w*w);
}
third(int z)
{
w=z;
}
}
class first extends Thread
{
public void run()
{
for(int i=1;i<3;i++)
{
Random r=new Random();
int y=r.nextInt(1000);
System.out.println(y);
if(y%2==0)
{
Second s=new Second(y);
s.start();
try
{
sleep(1000);
}
catch(InterruptedException e)
{
}
}
}
try
{
sleep(1000);
}
catch(InterruptedException e)
{
}
}
}
public class dext
{
public static void main(String args[])
{
first fr=new first();
fr.start();
}
}
OUTPUT:
-----------------BY KOMAKULA RAMESH