; Computer comp; //One computer per person, one class can be used as a property Public voidStudy () {SYSTEM.OUT.PRINTLN ("Our students learn all with the" +comp.brand+ "CPU of the computer is" +comp.cpu); } Public voidSayHello (String sname) {System.out.println (name+ "Say hello to" +sname+ "); } Public Static voidMain (string[] args) {computer C=Newcomputer (); C.brand= "Lenovo"; C.cpu= 920; Student S1=NewStudent (); //student
Graphical ReentrantLock0. DemoI first give a demo, so that everyone can according to the code I gave, debugging side to see the source. Or that sentence: Pay attention to "my", I renamed the Reentrantlock class for "Myreentrantlock" class, "Lock" class renamed to "MyLock" class
running environment
Jdk\jre\bin
Executable and dynamic link library files including platform runtime tools and class libraries
Jdk\jre\lib
Includes code libraries for Java runtime environments, default installation files, and more
Jdk\lib
Include Class library files
Java reflection Class -- class, java reflection -- Class
Let's first look at the functions provided by reflection:
The reflection mechanism provides the function to determine the data type, parse the class structure, and obtain in
First, ArraysFor the tool class for array manipulation, some methods for array sorting and binary searching are provided.Common methods:1. public static string toString (Int[] a): Converts an array of type int to a string.Converted to a string after the output form: ([element 1, Element 2, Element 3 ...]), arrays overrides the ToString method at the bottom.2, public static void sort (int[] a): Sorts the specified array of type int in ascending order o
After two days of hard work, don't say anything, first come to a picture:
Looks so beautiful, O (∩_∩) o haha ~
The experimental environment is Ubuntu.
1.JDK version must be 1.7 or below, JDK1.8 No, always error,
2. Download Sootclasses-2.5.0.jar Package: http://download.csdn.net/download/sheshizhang/4573588
Can be on the GitHub on the official website of the small example to try Taker: Https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool
3. Following the formal use of
path already exists in the system variable, so we click Edit, add%java_home%\bin;%java_home%\jre\bin to the front ; Remember that there must be a semicolon (;) in the end.③classpath is the Java Load Class (Classorlib) path, only the class is in Classpath, the Java command is recognized, set to:.; %java_home%\bin;%java
ZigZag Conversionfirst, the topic is as follows:The string "PAYPALISHIRING" is written in a zigzag the pattern on a given number of rows type this: (The want to display the this pattern in a fixed Font for better legibility) P A H NA p L S i i GY i And then read on line : "PAHNAPLSIIGYIR" Write the code that would take a string and make this conversion given a number of rows:String convert (string text, int nRows); convert("PAYPALISHIRI
The following is an inheritance relationship diagram of the collection type in the downloaded Java to facilitate correct understanding and use of the corresponding collection type.
Ordered or not
Allow repeated Elements
Collection
No
Yes
List
Yes
Yes
Set
Abstractset
No
No
Hashset
Treeset
Yes (Binary Tree sorting)
When reading other people's code and without detailed documentation, how to quickly see the entire code structure (class structure) becomes a real problem. today I will introduce a method for automatically generating UML diagrams.
When reading other people's code and without detailed documentation, how to quickly see t
same place as the runner1 element, and remember it as walker1. The reason for Walker1 in the front part is that it is impossible to find a larger interval containing the [walker1,runner1] interval so that there is no repetition, because there are already repeating elements in the [Walker1,runner1] interval. So the next target range can only go forward, the lower interval is lost, at this point to the third step;three , the Walker1 front (including itself) lost, the problem back to the first s
Observer mode analysis, structure diagram, and basic codeZookeeper
Definition: The Observer mode defines a one-to-many dependency, allowing multiple observer objects to listen to a topic object at the same time. When the status of this topic object changes, it notifies all observer objects so that they can automatically update themselves.Structure:
Subject Class, which can be translated as a topic or abstra
An introduction to the non-direction graph of adjacency table
The non-direction graph of adjacency table refers to the graph represented by adjacency table.
The above figure G1 contains "a,b,c,d,e,f,g" a total of 7 vertices, and contains "(A,c), (A,d), (a,f), (B,c), (C,d), (E,g), (f,g)" A total of 7 sides.
The matrix to the right of the above figure is the G1 intention of the adjacency representation in memory. Each vertex contains a list of linked lists that record the ordinal number of th
Graphical Condition0. DemoI first give a demo, so that everyone can according to the code I gave, debugging side to see the source. Or that sentence: Pay attention to "my", I renamed the Reentrantlock class for "Myreentrantlock" class, "Lock" class renamed to "MyLock" class.
Template Method mode analysis, structure diagram, and basic codeZookeeper
Definition: The template method mode defines the skeleton of an algorithm in an operation, and delays some steps to the subclass. The template method allows the subclass to redefine certain steps of an algorithm without changing the structure of an algorithm.Structure:
AbstractClass is an abstract class, which is actually an abstract
Java configuration context. xml file method diagram, javacontext. xml
Modify the context. xml file
After learning the servlet, every time you modify the content, you have to restart the server to access the servlet. This is very troublesome. So today, we will teach you a way to solve this problem with just one line of code."No need to restart the server".
See
the session mechanism. Just as a supplement, the server responds by modifying the form form and adding a sessionid-like hidden field that can be flagged when it is passed back to the service.
This technique can also be used on web security to effectively control CRSF cross-site request forgery .
three, details seesion mechanism process This is the detailed diagram of the first request of the session. With Cookie technology, I als
) { DoubleD =Math.random (); System.out.println (d); //print random number between 0 and 1 } } Public Static voidfunction5 () {DoubleD = Math.Round (1.4234); System.out.println (d); //output 1.0, get rounded value }}Arrays class: Array tool classes that help us do some things with arrays:Some methods can save us a lot of code in daily developmentExample: Packag
abstractions to isolate similar changes that occur later.In the face of demand, changes to the program are made through new code, rather than changing the existing code. This is the spirit of the ' open-and-close principle ', which leads to the enormous benefits claimed by object-oriented technology. That is, maintainable, extensible, reusable, and flexible.Structure diagram:Basic code:Using System;Using S
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.