3.1 建立新的数据类型: class



Historically, however, most object-oriented languages have used the keyword class to mean "I 'm about to tell you what a new type of object looks like."
 
class ATypeName { /* class body goes here */ }
这样就建立了一种新的类型,接下来就可以用new创建这种类型的一个新对象:
ATypeName a = new ATypeName();

Next Page