Method Argument types: Niladic, Monadic, Dyadic & Triadic

Method arguments come in various flavours.

Niladic
The method contains no arguments, this one can be easy understand, for example, Java’s ‘ToString()’ method

Monadic
The method contains a single argument. Java’s base class Object#equals(Object obj)

Dyadic
A method with 2 arguments, for example the String method replace……. replace(char oldChar, char newChar).

Triadic

Method with 3 arguments
Example StringBuffer’s replace method…. replace(int start, int end, String str)

Polyadic
A method that for some reason has more than 3, such as the String method ‘regionMatches’ which can be confusing to know which order the arugments come in (without looking at the doc)

It looks like this “regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len) ”

I will be talking more in detail about these method arguments types in a later blog post.
Ced

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s