This is a program to assign global variable with command line args:

class B
{
int x;
B ref;
B (int data)
{
this.x=data;
}