It's not a secret anymore!*
The moose likes Java in General and the fly likes VB & Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "VB & Java "Option"  Question." Watch "VB & Java "Option"  Question." New topic
Author

VB & Java "Option" Question.

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

Hi All

I have a function having

public void getTel(String str, String Narration1, String Destination)

Like in Visual Basic we normally use Optional command between parameters like

public void getTel(String str, String Narration1, Optional String Destination)

Due to which we are capable to use the same function regardless of declaring Destination parameter.

Is there any type or anything available in java who can do the same for me.

ANAND KARIA


Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Yes, method overloading.

http://java.sun.com/docs/books/tutorial/java/javaOO/methoddecl.html


Tony Morris
Java Q&A (FAQ, Trivia)
 
jQuery in Action, 2nd edition
 
subject: VB & Java "Option" Question.
 
Similar Threads
Can we convert "Array of Strings" to a "String"??
formal parameter on functions in java
whether Object is a keyword?
Strings
JNI