[java][9][源码]类

xiaoxiao2021-02-28  15

java小白的学习记录......

public class class1 { //类的属性 String schoolName; int classNumber; int labNumber; //类的方法 public void showCenter(){ System.out.println(schoolName+" is provided with " +classNumber+" class rooms " +labNumber+" lab rooms "); } public static void main(String[] args){ class1 center=new class1(); center.schoolName="XuZhou"; center.classNumber=20; center.labNumber=40; center.showCenter(); }}

转载请注明原文地址: https://www.6miu.com/read-1450284.html

最新回复(0)