Student Portfolio >> Index >> Coding >> JAVA Exercise 3
// filename: PointCreate.java
public class PointCreate
{
public static void main( String args[])
{
Point p = new Point(10,20); //calls constructor
System.out.println("x=" + p.getx() + "y=" + p.gety());
p.setx(700);
p.sety(700);
System.out.println("after setter/getter function: x=" + p.getx() + "y=" + p.gety());
}
}
<< Back Forward >> |
Copyright 2005 Kerstin Kegel