Java programming ideas highlights comments II

Source: Internet
Author: User

 

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.