Java-basic-1

Source: Internet
Author: User
Tags integer division java se

1.

Java Standard Edition (Java SE)

Java Enterprise Edition (Java EE):

Geared toward developing large-scale, distributed networking applications and web-based Applications
Java Micro Edition (Java ME):
Geared toward developing applications for small, memory-constrained devices, such as cell phones, pagers and PDAs.

2. Javadoc Comments:

Start with/**, */end; Javadoc Utility program read Javadoc to do HTML documents

3. Implicitly imports Java.lang, so do not write

4.

Class naming: The first letter of each word capitalized: ClassName, cannot start with a number

Naming of variables and functions: First letter lowercase, other initial capitals: Variname

5.

Turn into. class containing Java bytecodes
Javac Filename.java
Javac *.java multiple Java files compile at the same time
Translated by the JVM for OS, execute
Java fileName

6. Integer Division: The fractional part is discarded directly

7. Static method:
You do not need to create an instance of it to work with. Main is static and can have a main in each class, depending on which Java command to use.

8.

Primitive types:
Boolean, Byte, char, short, int, long, float, double
Reference types:
Objects that is referenced may each contain many instance variables and methods. Not primitive, or reference.

Here is the code time:)

For dialog windowimport javax.swing.joptionpane;//only one Publicpublic class Test {public static void main (string[] Ar GS) {//Standard output object. To command LineSystem.out.print ("first");//Add/nsystem.out.println ("Hello world!"); /Format-controlfloat i = 3.2f; System.out.printf ("%s\n%.2f", "Hello", I);//Input dialog window. Get input. String name = Joptionpane.showinputdialog ("What ' s your name?"); /format control of stringstring msg = String.Format ("Welcome,%s", name);//first:position of window. NULL = Centerjoptionpane.showmessagedialog (null, MSG);}}

  

Java-basic-1

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.