Start to learn Java, the first is the configuration of the Java programming environment, first download the JDK from the official website, installation, here to remind, it is best not to put in the C-disk, record the address of the storage, the
In Path SUm 1 (http://www.cnblogs.com/hitkb/p/4242822.html)We save the path in the form of a stack, and each time we find a matching leaf node, the elements in the stack are output. Note the case where multiple paths exist. PublicList> pathsum
Use
Status mode (state)
When an object's internal state changes to allow its behavior to change, the object looks like it has changed its class.
State mode is aBehavioral Patterns。StructureDiagram-state mode structure diagram
The
code is as follows:
The first is calculated in milliseconds.
long starttime = system.currenttimemillis (); //Get start time
dosomething (); //test code snippet
Long
Recently, Java has been used to implement the observer pattern in design mode, the source code is as follows: Package Cn.demo;public class Testobersver {public static void main (string[] args) {people person=new person ();//Declaration by Observer
Use
Visitor Mode (Visitor)
Represents an operation that acts on each element in an object structure.It allows you to define new actions that act on these elements without changing the class of each element.
The visitor pattern
File Location:File contents:Code:public class test{public static void Main (string[] args) throws ioexception{ Properties Pro = new Properties (); C3/>fileinputstream in =null; try{in = new FileInputStream
Use
Abstract Factory provides an interface to create a series of related or interdependent objects without specifying their specific classes.
Abstract Factory mode is a type of creation pattern .structureFigure-Abstract factory
First reason PS generates a PNG image with a transparent background and then sets the transparent properties of the JPanel panel, which is panel.setopaque (false); set to TransparentClassMypanelextendsjlayeredpane{ PublicMypanelone Panel
Valid Java, inclutivejava
Inheritance is one of the methods for implementing code reuse, But improper use may cause many problems.
Inheritance destroys encapsulation, and it is dangerous to inherit a specific class at the cross-package access
Ubuntu14.04 install JDK and ubuntu14.04jdk
Download from Sun's official website
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Select accept license, and then select JDK download suitable for your
Shallow clone and deep clone in Java
Summary
The concept of shortest cloning and deep cloning is a relatively low difficulty factor for JavaSE, but it should not be ignored.
Assume that there is no direct operation on a list in the code, but the
[Convert] to achieve File compression and File compression
/** Create a compressed file, from is the folder path, to is the compressed file path after creation */public void CreateZip (String from, String) throws IOException {List list = getFiles
Properties property file Design & Practice (1), properties property design
In a project, an attribute file such as config. properties systemconfig. properties usually exists under the class path. You can use the attribute file to achieve the
Java basics --- explanation of JSP built-in objects, basics --- jspIn JSP, nine built-in objects are provided to simplify user development. These built-in objects are instantiated by containers for users and can be directly used by users, instead of
Scope of JSP-scope (web basic learning notes 5) and web Learning notesScope of JSP)
Objects on the JSP page, including user-created objects such as JavaBean, all have a range attribute, which is also called "Scope ". The range defines the time at
Big talk design model? -- Decorative Mode
The weekend is coming again. After training, I will continue to study the design model. As a coder, my health is also very important. I have to exercise well on weekends, the message that Yao beina died most
Design Pattern series-simple factory pattern
The simple factory model is the most basic design model we come into contact with the design model. When writing a program, some classes may be involved. Which class should be instantiated during use?
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