Friday, 6 September 2013

How do I make a function accept any type (not necessarily an object)?

How do I make a function accept any type (not necessarily an object)?

I have a function
boolean isValid(/* what goes in here? */) {
//do stuff
}
In the function signature, what do I have to enter in the parameter list
in order for the method to accept a single parameter that may be of any
type (primitive or object)?
I have searched around on this site and google, but I could only find
situations where the return type is unknown.

No comments:

Post a Comment