NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
Java File
1. INDEX
Sr. No. Program Remarks
1.
Write a program on Multithreading
2.
Write a program on Input/output Stream
3. Write a program on Interfaces
4. Write a program on Applet
5. Write a program on SWING Application
6. Write a program on JDBC
7. Write a program on Servlets
8.
Write a program on JSP
9.
Write a program on Sending E-Mail
10.
Write a program on Implementing RMI
2. Program No1: Write a program on Multithreading
import java.io.*;
class a implements Runnable
{
Thread t;
a()
{
t=new Thread(this, "thread1");
t.start();
}
public void run(){
try{
System.out.println("Manish");
Thread.sleep(1000);
}
catch(Exception ex){
}
}
}
class thread1{
public static void main(String arg[]){
try{
for(int i=0;i<=5;i++)
{
new a();
Thread.sleep(500);
System.out.println("Jain");
}
}
catch(Exception ex)
{
}
}
}
4. Program No2: Write a program on Input/output
Stream
import java.io.*;
class inputoutput{
public static void main(String args[])
throws IOException
{
char c;
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
System.out.println("Enter characters, 'q' to quit.");
do
{
c = (char) br.read();
System.out.println(c);
}
while(c != 'q');
}
}
9. Program No4: Write a program on Applet
import java.applet.*;
import java.awt.*;
/*<applet Code="face.class" Width=600 Height=600>
</applet>*/
public class face extends Applet
{
public void paint(Graphics g)
{
g.drawString("Applet Program",250,50);
g.drawOval(200,100,200,200);
g.fillOval(250,150,30,20);
g.fillOval(320,150,30,20);
g.drawLine(299,150,299,225);
g.drawArc(274,200,50,50,210,120);
}
}
22. Program No 8: Write a program on JSP
<%@ page language="java"%>
<html>
<head>
<title>Even number program in JSP</title>
</head>
<body>
<%
for(int i=0;i<=20;i++)
{
if((i%2)==0)
{
out.print("<center>");
out.print("Even number :"+i);
out.print("<br></center>");
}
}
%>
</body>
</html>
31. byte[] st(String str)throws RemoteException;
}
Server Program:
import java.rmi.*;
public class StackServer
{
public static void main(String arg[])
{
try
{
StackImpl im=new StackImpl();
Naming.rebind("hai",im);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
32. OUTPUT of SERVER file:
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
exception is: java.net.ConnectException: Connection refused: connect
OUTPUT of CLIENT file :
Enter the Ip Address :
127.0.0.1:1052
Enter the File Name :
lok.txt