First, let's review the Java variable types:
Instance variable: no static attribute is added to the class property and is stored in each class object instance. The system assigns a default value to it.
Class variable: the owner of the static class
Value assignment operator
The value assignment operator is a combination from right to left, and the value of the table formula is the value on the right, for example:
Int A = 0; A = 3;
AboveCodeIn, the value of a is 3, and the value of
/* 1. Define a function used to print the rectangle 1. Define a function */class functiontest {public static void main (string [] ARGs) that prints the multiplication table of 9-9 characters) {draw (5, 5); Fenge (); Draw (8, 8); Fenge (); print99 ();
/* Requirement: Get a paragraphProgramPrinciple of running time: Get the start time and end time of the program and subtract it to get the time: use an existing class in Java: system. currenttimemillis (); whenCodeAfter optimization, we can solve
/* IO Exception Handling Mechanism */import Java. io. *; // import the IO package class filewriterdemo2 {public static void main (string [] ARGs) {filewriter fw = NULL; // In tryCodeDefine FW before the block to ensure that fwtry {fw = new
Class first:
package ExtendsTest;public class First { int a=1; public void print() { System.out.println(a); }}
The second type is as follows:
package ExtendsTest;public class Second extends First{ int a=2; int b=3; public void print() {
The Java platform implements socket in the java.net package .. Net packages mainly work by the following three classes:
· Urlconnection · socket · serversocket contains more classes in the java.net package, but these are the most common ones. Let's
Java serialization Introduction
The serialization process is to write the object into the byte stream and read the object from the byte stream. After converting the object state into word throttling, you can use java. each byte stream class in the
Summary of system variables in Java:
Java. version Java Runtime Environment versionJava. vendor Java Runtime Environment vendorJava. vendor. url URL of the Java vendorJava. Home Java installation directoryJava. VM. Specification. Version Java
Today, the instructor asked 1/0, 1.0/0, 1/0. 0, 1.0/0.0
I still have no details ~~~~ Take a good look .......!!!!!!!!!!!!!!!!!!!!!
1. I = I + 1?
A number will never add 1 to itself? Java enforces the use of IEEE 754 Floating Point Number
Recently, I have been studying j2s. I personally think that the biggest problem with java lies in the lack of property rights protection. java is very good, but the code that I have worked hard to write can be easily used by others for reference,
1. Declare a map: Map map = new HashMap ();2. Place values in map. Note: map is stored in the form of key-value. For example:
Map. put ("sa", "dd ");
3. Select String str = map. get ("sa"). toString () from map. The result is str = "dd ";
4.
This example uses Java to simulate the Socket server. After the client sends the request information to the server, it obtains the XML Information of the server and then parses and processes it.
1. Socket server
Import java.net. *; import java. io.
DBSource. java
Package com. aspboy. base. database;
/** Creation date:** To change the template of the generated file in TODO, go* Window-preferences-Java-code style-Code Template*/
Import java. SQL. Connection;Import java. SQL.
Implemented using the CountDownLatch class
Main thread
Package test;
Import java. util. concurrent. CountDownLatch;
Public class Main {
/**** @ Author Administrator/2012-3-1/09:36:55 AM*/Public static void main (String [] args ){
Int threadNum
Http://blog.csdn.net/jserkang/archive/2005/03/13/318623.aspx
Connect to 9588 SMS gateway (http protocol), and 9588 of the text message service URLs on iis require authentication,
URL used in the program: http: // UserName: Password@000.000.000.000/
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