Here is chance to win $100 cash via bloggertricks.com
Sponsor is provided by
homeimprovementcorner
banner-ad-blog
Contest link:Win $100 cash
How to participate in it?
-comment
-digg the post
-Write a review about the post.
-Add banner in your site about the contest.
-Subscribe.
All the best!!cheers:)
For Mozilla user's
* To copy an image in orkut in case if right click is blocked.
1.Drag the image and put in the Address Bar.
2.You will get direct location of de images from orkut image Server.
3.Right click and choose save picture as.
Other ways are by using Fire Bug and page source and obtaining de link i will continue it later:)
AddServerIntf.java
import java.rmi.*;
public interface AddServerIntf extends Remote
{
double add(double d1,double d2)throws RemoteException;
}
AddServerImpl.java
import java.rmi.*;
import java.rmi.server.*;
public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf
{
public AddServerImpl()throws RemoteException
{
}
public double add(double d1,double d2)
{
return d1+d2;
}
}
*AddClient.java
import java.rmi.*;
public class AddClient
{
public static void main (String args[])
{
try{
String addserverURL="rmi://"+args[0]+ "/AddServer";
AddServerIntf addserverintf=(AddServerIntf)Naming.lookup(addserverURL);
System.out.println("The first number is:"+args[1]);
double d1=Double.valueOf(args[1]).doubleValue();
System.out.println("the second number is:"+args[2]);
double d2=Double.valueOf(args[2]).doubleValue();
System.out.println("The sum is:"+addserverintf.add(d1,d2));
}
catch(Exception e)
{
System.out.println("Exception:"+e);
}
}
}
*AddServer.java
import java.net.*;
import java.rmi.*;
public class AddServer
{
public static void main(String args[])
{
try{
AddServerImpl addserverimpl=new AddServerImpl();
Naming.rebind("AddServer",addserverimpl);
}
catch(Exception e)
{
System.out.println("Exception"+e);
}
}
}
1.Compile al the files.(javac filename.java)
2.Create stub and skeleton for your AddServerImpl.java using the following command
rmic -vcompat AddServerImpl
3.Run the rmiregistry from bin of your jdk folder,leave it unclosed.
4.Run your server file with foolwing command:
java AddServer
5.Open new command prompt window,set the path and run your client code:
java AddClient 127.0.0.1 1 1
6.u should c the summed up value,here 127.0.0.1 is the local host(ur own system).
**If the program is not working set the CLASSPATH in the environmental variable:
Right click my computer->properties->advanced->Environment variable(at de bottome)
In the user variable click new type name as CLASSPATH and for value set u r path where ur java code resides.
Eg:c:\java\rmi





