Encapsulation is the process and data is surrounded, access to data only through the interface defined. Object-oriented computing begins with this basic concept that the real world can be portrayed as a series of fully autonomous, encapsulated
PackageItcast.feng;ImportJava.util.Scanner;//Requirements: Triangular digital array for output n=6//1//2 3//4 5 6//7 8 9// one by one// from//analysis: See positive triangle, think for loop format, outer loop control line, Inner loop control column,
A class, either directly inheriting object or indirectly inheriting object, as follows:
Class a{}Class B extends a{}
B is a subclass of a, and a is a subclass of object, so B indirectly inherits object.So, we can say this:
A brief review of the design of Concurrenthashmap in jdk1.7A simple look at the design of Concurrenthashmap class in jdk1.7, its basic structure:Each segment is a hashentry[] table, and each element in the table is essentially a hashentry one-way
Variable parameter features:1) ... Can only appear at the end of the argument list2) ... Between the variable type and the variable name3) When invoking a method of a mutable parameter, the compiler creates an array for the mutable parameter
OverviewJava I/O operations classes in the package java.io, about nearly 80 classes, but these classes can be divided into four groups, respectively:Divide by processing data type: byte stream and character stream :
Byte-based operation of
(i) Java static code block static method differencesIn general, if some code must be executed at the time of project startup, the use of static code blocks, the code is active, it needs to be initialized when the project is started, in the case of
There are four basic types in Java, of which integer is divided into Byte, short, int, long, floating-point type float, double, char, Boolean. 8 Types of levels from low to high byte->short/char->int->long->float->double.Basic data type conversions
A card has two attributes, one is a suit (suit), one is a point (rank), and the following is a simple classCardPackage Com.syz.card;import Java.io.serializable;public Class card implements serializable{private static final long s Erialversionuid =
It is recommended in the Java program specification that you privatize the properties in the class, defined as private variables, and manipulate the properties by setting the set and get functions. Some people have this question, why not directly
1. The constructor method is a class method with the same name as the class.2, the construction method belongs to the class, does not belong to any object, cannot be called by the object reference created by the class.3. After creating an object
One of the major features of Java is that it inherits.1. Because a subclass inherits a parent class, it has a later polymorphism.2. Class inheritance, not to save code, inheritance for inheritance, and that no related classes linked together,
Lin Bingwen Evankaka Original works. Reprint please specify the source Http://blog.csdn.net/evankakaAbsrtact: This paper mainly discusses the source code analysis of Copyonwritearraylist and Copyonwritearrayset in Java.One, copyonwritearraylist
1. In general, Java Virtual machines are divided into: stacksStack in the data structure is that advanced out of the stack. Heap... I feel big when I hear that name. After all, we describe a lot of things and nothing most of the time is a bunch of
The implementation is relatively simple, basically with serversocket and socket on the line,Another thread to listen to, basically there's no problem.Code:
The thread responsible for listening:1 PackageNetwork;2 3 Importjava.io.IOException;4
The enum (enum) type is a new feature of Java 5, which is a novel type that allows represented to represent specific pieces of data and is all represented in type-safe form. 1, the use of constantsBefore JDK1.5, we define constants that are:
Analysis of jsp interface inheritance or not, jsp INTERFACE ANALYSIS
Page Introduction
$ {PageContext. request. contextPath} is the page context path;It can also be implemented using js;
is equivalent to:
You can write the following code on the
Sort-bubble sort, sort bubble
During the interview, I was occasionally asked about the sorting algorithm. Sometimes I was asked to write the sorting algorithm, but it was never taken seriously. During the interview the day before yesterday, we were
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