Public static void main (string [] ARGs) throws exception { // solve Chinese garbled characters // read a line from the IO stream inputstreamreader ISR = new inputstreamreader (New fileinputstream ("C: /Windows/windowsupdate. log ")," UTF-8 ");
I haven't used Java for a long time. Today, a new Java student asked me not to use the EQUAL () function to help him determine whether the strings are equal, let's review Java.
Package bzu.edu.cn; public class text { /** * @ Param ARGs */
I recently saw an interview question about the Java initialization sequence. Specially recorded:
Public class o { Public O (string s) { system. out. println (s ); } Public Class A { private o t2 = new O ("parent class instance variable 1" );
I haven't been here for a long time. I found that although I read a lot of materials and books, it is easy to forget things I haven't touched for a long time. We hope to record more records in the future.
Today, I played the thread pool, made some
APIs are often provided at work. At this time, the interface documentation is very troublesome and maintained on the Wiki or elsewhere. However, after the code is modified, the Wiki may not be updated in time, it causes a lot of communication costs.
Pre-JDK 5 used synchronized for multi-thread locks, and JDK 5 used Java. util. Concurrent. locks. Lock as the interface. In addition, java. util. Concurrent. locks. readwritelock provides a pair of locks for concurrent read/write. Reentrantlock Is A
A five-game that I wrote a long time ago has been changed over the past two days. The Code is as follows:
Wuziqi. Java
Game. Java
Point. Java
Inpututil. Java
Mainclass. Java
Public class wuziqi { Private Static final int ROW = 9; Private Static
Inheritance:That is, subclass inherits and extends the features of the parent class.
I have three classes:Grandfather father sonThe relationship is Level 1 Inheritance Level 1.
There is a common method in it:Public void tellstory ()
Directly run the
Sometimes you want to define a class member so that its use is completely independent of any object of the class. Generally, a class member must be accessed through its class object, but can create such a member, which can be used by itself without
Private Static int bitsperword = 32;Private Static int shift = 5;Private Static int mask = 0x1f;Private Static int n= 99999999;
Static int [] A = new int [1 + N/bitsperword];
Static void set (int I ){
A [I> shift] | = (1 }
Static int get (int I ){
Document directory
Source code
Source code
The merging mode belongs to the object structure mode, and is sometimes called the "part-whole" mode. The merging mode organizes objects into the tree structure and can be used to describe the
Pattern class:The pattern method is as follows:Static pattern compile (string RegEx)Compile the given regular expression and assign it to the pattern class.Static pattern compile (string RegEx, int flags)Same as above, but the flag parameter is
Every time you do something, whether it is development or testing, you have to write the classes and methods that connect to the database. In fact, there is no big difference, in addition, the interface functions provided by the existing JDBC are
Deleting a folder includes the following situations: files in the folder, subfolders (with files) in the folder, and subfolders (empty folders) in the folder ). Therefore, the program should be written to address these three situations. Import Java.
You only need to write the class and call it in the background:
Import Java. security. messagedigest; public final class md5token {Private Static char hexdigits [] = {'0', '1', '2', '3', '4', '5 ', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E ', 'F'};
Java interview sunflower collection 58. Different information flows
C/S programs are generally typical centralized mechanical processing, with relatively low interaction.
B/S information flow to changeable, B-B B-C B-G and other information, flow
Method: system. getproperty (propertyname );
Propertyname can be the following values:
Java. runtime. Name: name of the Java Runtime Environment
Bin directory of sun. boot. Library. Path JRE
Java. VM. Version Java Virtual Machine version
Strategy Mode
Definition:Runtime Selection Algorithm
On the surface, the state mode and the Strategy Mode are very similar, but since they are divided into two different modes, there are some differences. In a word, they are summarized as
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