Reading notes--the Java language Programming--Basic article

Source: Internet
Author: User

First, overview:
This is the first to read the original English professional books, in general, because they have some foundation, reading is not very laborious.
The first half of the main is to introduce the Java related syntax, just by this opportunity to consolidate the ability of their code, basically the book
The code is played again, the front part is mainly used by the notepad++ to write, notepad++ also have code hint function, use up or quite
Good, but with CMD to compile, connect, javac and then Java execution, it seems very easy to appear coding format problems. The second part
The main use of myeclipse to write, but also try to IntelliJ idea, but because of the use of eclipse more accustomed to the reasons, not too
Adapt to its shortcut keys, writing is not very cool, so forget it.
The middle also tried to package the Java program, so that it can run on a machine that does not have the JRE installed, jbuilder,exe4j in the middle,
INSTALL4J,EXE4J is easy to use, (but in fact many of the options I've ignored), it can package Java programs into EXE
File, but the JRE support is still required. Others are more complex to use. Later think about, in the win Environment EXE program, still count
Take c#,c++ and the like to write well. In fact, the difference between basic grammar is not very big.
Second, thinking (overall):
1, Java Environment configuration problem, JDK is the developer use of development tools, including the JRE, documentation, some sample code,
and source code. It is very important that in the bin directory under the JDK root directory, you can add it directly to the path directory, which contains
Java.exe,javac.exe, and other documents. As for the JRE, Java Runtime Environment is the necessary environment for executing Java programs, which
Contains the JVM, the Java virtual machine, that is responsible for the interpretation of Java bytecode.
2, Encapsulation (encapsulation), Inheritance (inheritance), polymorphism (polymorphism), first of all, packaging is mainly said to write class
Attention to achieve a high cohesion, that is, as a black box, only the external disclosure of the necessary methods and variables, but only for internal methods, variables
Use the Private keyword. Inheritance, that is, the largest embodiment of a code reusability, through the extends keyword, or implement interface,
Implement code reuse. (This one can see CHAPTER15, is a very good example of inheritance) very good use of Java inheritance when constructing
The invocation relationship of the function. Polymorphic, mainly through the class of upward transformation to reflect.
Third, code description
The code in the book basically hit the next, the following to do an introduction to facilitate their own reuse.
Chapter2:
Time.java: Realize the function, the system totalmilliseconds into Beijing time, due to the 8-hour jet lag, to carry out a
Plus 8 processing. In fact, the date class of Java implements this function.
Testscanner.java: Use Scannner to implement console input.
Showinput.java: The function is to display the user input on a dialog. used the Joptionpane.
Displayunicode.java: Encoded in Unicode 16bit, or "\u6b22\u8fce\u03b1".
Computeloan.java: Enter the loan and return the monthly payment.
Computearea.java:
Chapter3:
Readfile.java: Unable to read the file, the code has an error. But can be compiled through. 2015.5.25
Sub.java: A subtraction problem, judging the correct answer.
Chapter4:
Multiplicationtable.java: Hit 99 multiplication table.
CHAPTER6:
Countlettersinarray.java: Displays the number of occurrences of lowercase characters in a random character. Number of occurrences of the character count.
Randomcharacter.java: randomly generated characters.
Binarysearch.java: The sequence of binary lookup methods must be sorted. Find the number int.
Insertionsort.java: Insert method sort.
Linearsearch.java: Linear lookup method.
Selectionsort.java: Arranges from small to large, using the method of selecting sort.
TestSystemArray.java:Arrays.sort (a); Use this ready-made method for sorting.
Chapter7:
Circle.java,
Course.java (a class of simulated classes),
Seeds.java (random number obtained by seed)
Stackofintegers.java: This function simulates the function of an integer stack.
Chapter8:
Checkpalindrome.java: Judging whether a series is a palindrome number.
Counteachletter.java: Implements the number of occurrences of each letter in a string
Readdata.java: Read the file, use the scanner to read, pay attention to the input stream close off
Writedata.java: Use printwriter output file.
Chapter9:
1, through this example can see the order of the constructor call, first call the parent function of the parameterless constructor!
CHAPTER10:
Genericsort.java: The function of this class is to implement array sorting.
Testcalendar.java: This class tests the use of the Calendar class
Chapter11:
Rational.java: basic arithmetic of rational number, showing in fractional form, with "/"
Chapter12:
GUI-related programs. Showlayout.java,imageicon,panels,swingcommonfeature. And so on.
Chapter13:
is still GUI-side. Label, Messagepane, et.
Chapter14:
GUI aspect, there is dynamic clock, movablemessagepanel (can move the text, according to the mouse movement)
Keyboardpanel (use the upper and lower keys to control a letter, notice in the main method, must be setfoucus, can move)
CHAPTER15:
GUI-related programs. Multiplewindowsdemo (count the number of occurrences of letters and display them in a chart)
Radiobutton,checkbox and so on.
Chapter16:
Applets are used for small web pages, but try it with a browser, always using security issues, or reporting classnotfinderror.
Chapter17:
Exception handling. Throws,throw, try ... catch...finally.
Chapter18:
Java input-output stream, binary I/O.
CHAPTER19:
Recursion. The idea of recursion. Towersofhanoi, an example of Hanoi.

Reading notes--the Java language Programming--Basic article

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.