• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need details abut the pass an object into a method  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
help me out in clearing the concept of passing an object into the method or constructor?

Example link: http://download.oracle.com/javase/tutorial/java/javaOO/arguments.html



can also provide nice link or example so that i can understand it in better way.
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for what it's worth, you don't pass the object. you pass a reference to it. It's like handing the method a photocopy of your home address - you don't give it the actual house, but you tell it how to get there.

So what exactly are you trying to do? Your question as stated it rather broad, so it's hard to know how to guide you.
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what exactly do you not understand?

You can pass values to a method when you call it, and in the declaration of the method you have to specify what values it has to be called with. In your example you have a method polygonFrom that takes an array of Point objects as the argument.

Have a look at Defining Methods in Oracle's Java tutorials.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!