Socket Programming-UDP

UDP Program to print welcome Create 2 Files: 1)dsender.java 2)dreceiver.java dsender.java import java.net.*; //for java programming we have to use this package public class dsender //class name should be name as file name { public static void main(String args[]) throws Exception //throws exception should be written { DatagramSocket ds = new DatagramSocket(); //socket will create […]

Read More

RMI basic program-Add 2 numbers

1. Create Calculator.java file.Write following code in it. import java.rmi.Remote; import java.rmi.RemoteException; public interface Calculator extends Remote { public long add(long a,long b)throws RemoteException; }  2. Create CalculatorImpl.java file.Write following code in it. import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; public class CalculatorImpl extends UnicastRemoteObject implements Calculator { protected CalculatorImpl() throws RemoteException { super(); } public long add(long […]

Read More