Java interface usage learning ---------------- Java rookie to learn the first step

xiaoxiao2021-03-06  75

JCREATOR PRO 2.5JDK 1.4.2 =================================== / * * @ (#) CLSUSAGE .java 1.0 04/12/25 * * You can modify the template of this file in the * directory ../JCreator/Templates/Template_1/Project_Name.java * * You can also create your own project template by making a new * folder In the directory ../jcreator/template/. Use The Other * Templates As Examples. * / package myprojects.clsusage; import java.util. *; class clsusage {public clsusage ()}

Public static void main (string args []) {system.out.println ("Starting Clsusage ..."); isplitpage ISP = New UserPage (12); isp.firstpage (); while (isp.haspages ()) { isp.nextPage ();}}} interface ISplitPage {void firstPage (); void nextPage (); boolean hasPages ();} class dateObj {private String name; private int age; private boolean sex; private int id; public static int Personid; static {personid = 1000;} public DateObj (String Na, Int Ag, Boolean SX) {Name = NA; AGE = AG; SEX = SX; ID = DateObj.Personid ;} Public DateObj (String Na, Int Ag) {Name = Na; agent = true; id = true; id = Dateobj.Personid ;} public int getId () {return ID;} public string getName () {return name;} public void setName (String na) {name = public int getage () {return set (INT DG) {AGE = DG;} public boolean issex () {return this.sex;} public void setsex (boolean sx) {sex = SX; PUBLIC STRING TOSTRING () {return "" ID "-" Name "-" age "-" sex;}} class userPage implements ISplitPage {// which can be accessed with itself or son // package with itself or subclass where independent protected int pageCount; protected int pageIndex; protected java.util.Vector list Public userpage (INT PAGES) {IF (Pages <= 0) this.pageCount = 10; int Age = 20; Boolean SEX = false; list = new vector (); for (int i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-76700.html

New Post(0)