Human.java
public class Human
{
int head=1;
int eyes=2;
int nose=1;
int mouth=1;
int ears=2;
//:
//:
void run(int distance)
{
//...
}
void jump(int height)
{
//...
}
void eat(String food)
{
//...
}
void cry( )
{
//...
}
public Human( )
{
//:
//:
}
public Human(String sex)
{
//:
//:
}
}
class Main
{
public static void main(String[] args)
{
Human Adam=new Human();
System.out.println("亞當的眼睛有" + Adam.eyes + "個");
Human Eve;
Eve=new Human("female");
}
}
沒有留言:
張貼留言