<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Passing Parameters' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Passing Parameters' posted on the 'Java Beginners' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 03:11:07 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 03:11:07 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Passing Parameters</title>
      <link>http://www.programmersheaven.com/mb/java_beginners/431124/431124/passing-parameters/</link>
      <description>Hi,&lt;br /&gt;
I am a newbie and would appreciate it if someone could help me with the following code that I found on an online tutorial.&lt;br /&gt;
Thanks in advance,&lt;br /&gt;
Gus&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class PassObj &lt;br /&gt;
{ &lt;br /&gt;
        int n1; &lt;br /&gt;
        int n2; &lt;br /&gt;
        // constructor &lt;br /&gt;
        PassObj() &lt;br /&gt;
        { &lt;br /&gt;
                n1 = 0; &lt;br /&gt;
                n2 = 0; &lt;br /&gt;
        } &lt;br /&gt;
  &lt;br /&gt;
        PassObj(int p1, int p2) &lt;br /&gt;
        { &lt;br /&gt;
                n1 = p1; &lt;br /&gt;
                n2 = p2; &lt;br /&gt;
        } &lt;br /&gt;
  &lt;br /&gt;
        void multiply(PassObj p1) &lt;br /&gt;
        { &lt;br /&gt;
                int temp; &lt;br /&gt;
                temp = p1.n1 * p1.n2; &lt;br /&gt;
                System.out.println("Multiplication is " + temp); &lt;br /&gt;
        } &lt;br /&gt;
        public static void main(String args[]) &lt;br /&gt;
        { &lt;br /&gt;
                PassObj obj1 = new PassObj(5,6); &lt;br /&gt;
                PassObj obj2 = new PassObj(); &lt;br /&gt;
                obj2.multiply(obj1); &lt;br /&gt;
        } &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
This is a program I got from a Java tutorial online. If I give my understanding of it could someone please tell me if I am correct or tell me where I have gone wrong. I am a newbie so all help is greatly appreciated.&lt;br /&gt;
&lt;br /&gt;
1.	The class PassObj has two int variables n1 &amp;amp; n2.&lt;br /&gt;
2.	These as initialised to zero.&lt;br /&gt;
3.	In Main, there are 2 instances of the class PassObj created. These are obj1 &amp;amp; obj2.&lt;br /&gt;
4.	The multiply method is called with parameters 5 &amp;amp; 6 passed to it. The multiplication is done and the result is shown in the console.&lt;br /&gt;
My main issues are what is the point of:&lt;br /&gt;
&lt;br /&gt;
		PassObj(int p1, int p2) &lt;br /&gt;
        { &lt;br /&gt;
                n1 = p1; &lt;br /&gt;
                n2 = p2; &lt;br /&gt;
        } &lt;br /&gt;
and does the instantiation PassObj obj1 = new PassObj(5,6); actually pass parameters to the above constructor. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/java_beginners/431124/431124/passing-parameters/</guid>
      <pubDate>Wed, 30 Jan 2013 14:51:35 -0700</pubDate>
      <category>Java Beginners</category>
    </item>
  </channel>
</rss>