aspose file tools
The moose likes Beginning Java and the fly likes how to write constructor? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "how to write constructor?" Watch "how to write constructor?" New topic
Author

how to write constructor?

chanti kareti
Greenhorn

Joined: Mar 27, 2011
Posts: 1

array[0] = new MyClass();
array[1] = new MyClass(array[0]);

How can i write a constructor in MyClass, for above code. I required all the data in array[0] is have to copy in array[1].
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2927
    
  15

Welcome to JR,

please TellTheDetails PostRealCode so that we can help you out. Also you can search for java tutorials on the basics on OOP in Java


Mohamed Sanaulla | My Blog
Abubacker Siddik
Ranch Hand

Joined: Aug 12, 2009
Posts: 90
You want to create something like this??

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to write constructor?
 
Similar Threads
Garbase Collection Help
Garbage collection
Objects eligible for GC
Qustion about Garbage Collection
Shallow copy of array