i am beginner in java and had little confusion with these object creation.I was making this code for assigning object to other object
here is the code
i like to know how the gb and gb1 object can be declared inside its own class ???
class Obj {
float b;
public static void main(String[] args){
Obj gb=new Obj();
Obj gb1=new Obj();
gb.b=3;
gb1.b=4;
System.out.println("first--->"+gb.b+"\n Second"+gb1.b);
}
}
i like to know how the gb and gb1 object can be declared inside its own class ???