aspose file tools
The moose likes Beginning Java and the fly likes 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 "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: 16695
    
  19

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
 
Similar Threads
main method
IS CONCTRUCTOR IS A METHOD
WA #1.....word association
Constructor doubt - K&B Book
Can I overload a constructor with enum values?