您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes
Introduction
Content
Apply
Reflect
Extend
previous.gif
 (3087 bytes)
next.gif
 (2959 bytes)

 
 
Apply Index
Apply Page # 7

Exercise 4 ?Constructor method

Add to your Person class from Exercise 3 ?Class definition a constructor that requires arguments of age and name, and uses these arguments to set the initial values of these variables.

Discussion of Exercise 4
Back to content

basicline.gif (169 bytes)

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