View RSS Feed

Java Object

Parameter Types

Rate this Entry
by , 04-26-2012 at 05:16 PM (470 Views)
Any data type could be used for the constructorís or methodís parameter. Primitive data types are included in it like floats, integers and doubles, as it has already been seen in computePayment method. Reference data types are also included like arrays or objects.

Method which will be accepting array to be as argument has been shown in the given example. In this given example a new polygon object is being created by the method which initialized from Point objects array.
Java Code:
public Polygon polygonFrom(Point[] corners) {
    // method body goes here
}

Submit "Parameter Types" to Facebook Submit "Parameter Types" to Digg Submit "Parameter Types" to del.icio.us Submit "Parameter Types" to StumbleUpon Submit "Parameter Types" to Google

Categories
Tutorial

Comments