public function toLower():String{
return String.toLower();
}
public static function toLower( String inString):String{
//do stuff to string..
return newString;
}
PlanetOfLiving: return @"Earth" // No matter how many times you run this method...nothing changes.
实例方法
相反,实例方法发生在运行时,因为它是只有这样,你已经创建了一个可以在每次实例化时变化的实例。
initWithName: @"John" lastName: @"Doe"Age:12 @"cool"
initWithName: @"Donald" lastName: @"Drumpf"Age:5 attitude:@"He started"
initWithName: @"President" lastName: @"Obama"Age:54 attitude: @"Awesome"
//As you can see the value can change for each instance.