Index of AJ
Index of AJ
import java.util.*;
public class Main
{
public static void main(String[] args) {
int a,b,c;
System.out.println("Enter the value of a");
Scanner s1=new Scanner(System.in);
a=s1.nextInt();
System.out.println("Enter the value of b");
b=s1.nextInt();
try{
c=a/b;
}catch(Exception e){
System.out.println("there is an Exception in Program");
}
finally
{
System.out.println("Finally block Executed");
}
}
}
import java.io.*;
import java.net.*;
try {
} catch(Exception e)
System.out.println(e);
Output:-
Server Side
import java.net.ServerSocket;
import java.net.Socket;
import java.io.InputStream;
import java.io.DataInputStream;
public class Server
{
public static void main(String args[]) throws Exception
{
ServerSocket sersock = new ServerSocket(5000);
System.out.println("server is ready");//message to know the server is
running
Client Side
import java.net.Socket;
import java.io.OutputStream;
import java.io.DataOutputStream;
import java.awt.*;
ListBoxExample()
setLayout(new FlowLayout());
class ListBoxJavaExample
frame.setBounds(400,500,350,400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
import javax.swing.*;
import java.awt.*;
Object[][] data = {
{"MJP", "Morgan Stanley Dean Witter & Co.", 24.97, 24.97, 24.97, 1000, -0.04,-0.16}
};
table.setFillsViewportHeight(true);
lblHeading.setFont(new Font("Arial",Font.TRUETYPE_FONT,24));
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(lblHeading,BorderLayout.PAGE_START);
frame.getContentPane().add(scrollPane,BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(550, 200);
frame.setVisible(true);