File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes object creation in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

object creation in java

Aashish Jd
Greenhorn

Joined: Oct 14, 2012
Posts: 4
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 ???
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3101
    
  40

Please don't create duplicate topics. I'm closing this one. Let's continue the discussion in your other topic


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: object creation in java