public class singer
{
private int grate;
public void setGrate(int sgrate)
{
grate = sgrate;
}
public int getGrate()
{
return grate;
}
name c=new name();
}
public class name
{
public string name();
public void setName(String sName)
{
name = sName;
}
public int getName()
{
return name;
}
num b=new num();
}
public class num
{
public int number;
public void setNumer(String sNumber)
{
number = sNumber;
}
public int getNumber()
{
return number;
}
}
public class xunshou
{
public static void main(String[] args)
{
singer a = new singer();
a.setGrate(95);
int sgrate = a.Grate();
System.out.println(agrate);
ut.setName(“hello”);
String sName = a.c.getName();
System.out.println(sName);
a.setNum(95);
int sNumber = a.c.b.Grate();
System.out.println(sNumber);
}
java-day-4
最新推荐文章于 2024-05-09 00:07:29 发布