您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)

 

Apply Index

Apply Page # 6

Exercise 3 — Class definition

Create a Java source file defining a Person class with the following variables and methods:

Variables

age (a whole number)

height (a real number, such as 1.6 metres)

name (a piece of text, such as "Fred Jones")

Methods

`get' and `set' methods for the inspection and setting of the `height' variable

Discussion of Exercise 3
Back to content 

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg