Results 1 to 3 of 3
Thread: Two objects with the same name
- 05-15-2012, 09:31 AM #1lakshminarayana
- Join Date
- May 2012
- Rep Power
Two objects with the same name
i am new to java .does any one say is it possible to create two objects with the same name in the class
program code is....................
int a; //creating global variables a and b
Test13() //creating a constructor with out parameters
Test13(int x,int y) //creating a constructor with parameters
int mysum() // creating a function to add a and b
public static void main(String args)
Test13 object=new Test13();
Test13 object=new Test13(20,30);
System.out.println("sum of two variables is............:"+object.mysum());
Last edited by lakshminarayanaece2; 05-15-2012 at 09:47 AM.
- 05-15-2012, 01:47 PM #2
Re: Two objects with the same name
BB Code List - Java Programming Forum
When you have a question, start a new thread. Don't hijack another poster's thread.
Removed from http://www.java-forums.org/advanced-...-executed.html
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 05-15-2012, 01:47 PM #3
- By pantaloc in forum New To JavaReplies: 12Last Post: 04-29-2012, 02:55 PM
- By gmoney8316 in forum New To JavaReplies: 1Last Post: 05-06-2010, 02:03 AM
- By stamv in forum JDBCReplies: 1Last Post: 01-22-2009, 05:25 PM
- By kevinsong in forum Advanced JavaReplies: 16Last Post: 07-16-2008, 05:59 PM