cn.itcast.day06.demo02 Package Penalty for;
/ *
define a class, used to simulate the "mobile phone" thing.
Properties: brand, price, color
behavior: phone calls, send text messages
corresponds to class them:
member variables (attributes):
String Brand; // brand
double price; // price
String color; // color
member method (behavior):
public void call (String who) {} // call
public void sendMessage () {} // bulk SMS
* /
public class Phone {
// member variables
String brand; // brand
double price; // price
String color; // color
// member methods
public void call (String WHO) {
System.out.println ( "a" + who + "call");
}
public void the sendMessage () {
System.out.println ( "bulk SMS");
}
}