The sample program is as follows, this is what I passed, I don't know if you can pass it? Looking forward to the feedback of the people! ^ _ ^ This is the original article, please specify the original place! This article is first published: http://blog.9cbs.net/niko7/ The following is the code: package gfh.test;
/ ** *
Title: p> *
Description: p> *
Copyright: Copyright (c) 2004 p> *
Company: p> * @ Author Gufahua, Hangzhou * @version 1.0 * / public class person {static public void main (String [] Enter parameters) {gfh.test. people someone = New people (); a person. vend surname ("genius" ); A person .SET name ("A San"); a person .SET age (18); system.out.print (a person.tostring ());} private string surname = "[last name]" Private string name = "[Name]"; private INT age = 0; public people () {super ();}
Public void set name (String surname) {this. surname = (null == last name)? ": surname;}
Public void set (String Name) {this. Name = (null == Name)? ": Name;}
Public void set age (int age) {this. Age = age% 150;}
Public String GET () {RETURN Master;}
Public String get name () {return name;}
Public int GET age () {Return age;} public string toString () {Return this.GET name () this.Get name () "," this.Get age () "years";}} run After the output is as follows: genius A three, 18 years old