Note: (Restricted functionality due to obvious reasons!)
Minimal Code ( Raw-View ) :
import java.rmi.*;
import java.rmi.server.*;
public class IProgImp extends UnicastRemoteObject implements IProg
{
public int bal = 2000;
public IProgImp() throws Exception
{
}
public int bal() throws RemoteException
{
return bal;
}
public int deposit(int amt) throws RemoteException
{
bal = bal+amt;
return 1000;
}
public int withdraw(int amt) throws RemoteException
{
if(amt<0)
{
return 5001;
}
else if(amt<bal)
{
bal = bal-amt;
return 1000;
}
else
{
return 5010;
}
}
public void exit() throws RemoteException
{
System.out.println("Bye!");
}
public void exit(String str) throws RemoteException
{
// use some:log(str) -> to log errors-"str"
System.out.println("\n"+str+"\nBye!!");
}
}