:
- - , .
:
Java - - . . , , . . . .
, .
. , .
, . , , . ( , ) , , , .
, , . , , , , , , , .
Java.
Java java. , . . :
< >class< > { < > } |
public private. public, . private, , .
, , , .
- , . . , - . .
|
|
. , , .
, .
, height width.
public class Rectangle { //, private float width; private float height; // publicRectangle(float w, float h) { width=w; height=h; } //, public float getWidth() { return width; } //, publicfloatgetHeight() { returnheight; } //, public void setWidth(float w) { width=w; } //, publicvoidsetHeight(float h) { height=h; } } |
, , setWidth(), setHeight() (""), getWidth(), getHeight() ("").
, Java , .