File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "constructor" Watch "constructor" New topic
Author

constructor

charishma gottumukkula
Greenhorn

Joined: Nov 06, 2006
Posts: 20
Can we have parameterized constructor in java ?
Eric Daly
Ranch Hand

Joined: Jul 11, 2006
Posts: 143
absolutely
read up on sun's java tutorial
you could start on this page and follow the "trail" to learn more about constructors with different parameter lists
http://java.sun.com/docs/books/tutorial/java/javaOO/constructors.html


Studying for SCJP 6
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19073
    
  40

Originally posted by charishma gottumukkula:
Can we have parameterized constructor in java ?


If you mean parameters to the constructor, then as Eric pointed out, the answer is obviously yes.

However, when you say "parameterized", do you mean parameterized types? Like so...



The answer is yes. Java supports generics with constructors -- just like the support for generic methods.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: constructor