This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

object creation in java

Aashish Jd

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();

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: 3018

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

Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
jQuery in Action, 2nd edition
subject: object creation in java
Similar Threads
object creation in java
Can anybody Explain the Program
Garbage Collection question
Another Garbage Collector question
Garbage Collection question