To learn a programming language, you must first understand its design philosophy. To learn the Java language, the most important thing is to understand the essence of Java's design-that is, Object-Oriented Programming (OOP ). This chapter aims to introduce some background, concepts, methods, and methods in OOP. Therefore, you do not have to be as stylized as learning programming. you can immerse yourself in it as you read story books and gradually understand the essence of OOP design.
The hashcode value must be of the int type. Here, it is a common hash algorithm for several data types. You can refer to these hashes to implement your own hashcode () function.
The following is a light bulb design class, which abstracts the basic features of the light bulb: turn on, turn off, turn on, and darken.
It is a UML diagram representation of Java classes. The Unified Modeling Language (UML) is a tool for expressing OOP class design in a graphical way. It facilitates visual design of OOP through UML.
When this type of light is used, use the new keyword to create an instance lt, and then use this instance variable to call different methods to perform operations on this lightbulb.
Light lT = new light ();
Lt. On (); // turn on the light
This article is excerpted from the book Java programming ideology (4th edition) (Commentary edition.
The book Java programming ideology (4th edition) (Commentary edition) has been officially published by the Electronics Industry Press, and this book is commented by Liu zhongbing
Dangdang:
Http://product.dangdang.com/product.aspx? Product_id = 21106091 & ref = search-1-Pub
Excellence:
Http://www.amazon.cn/Java%E7%BC%96%E7%A8%8B%E6%80%9D%E6%83%B3-%E5%88%98%E4%B8%AD%E5%85%B5/dp/B0055T5XVW/ref=sr_1_1? Ie = utf8 & qid = 1308711461 & sr = 8-1
China Interactive publishing network:
Http://product.china-pub.com/194002