Java Base Grammer

Source: Internet
Author: User
Tags throw exception java keywords

time:2016.7.27.
Theme:java Base Language grammar
*********************************************************************
1. Case sensitive
2. Class Name: Myfirstjavaclass
3. Method Name: Maxapple
4. source file name: Class: Myfirstjavaclass, Filename:MyFirstJavaClass.java
5. Main method entry: public static void Main (string[] args)

The difference between a class and a method.
6.java identifiers: Start with a letter (A-Z or a-Z), a dollar symbol ($), or an underscore (_)
Public add () {} Add.
Class login () {} login.
int Username;username.

7. Modifier: Accessible modifier: Default, public, protected, private
Inaccessible Modifiers: final, abstract, STRICTFP

8.java variables: Local/class variables (static variables)/member variables (non-static variables)

9. Arrays:
10. Enumeration:
11.java Keywords:

Keyword description
Abstract abstraction method, modifier of abstract class
Assert asserts whether the condition satisfies
Boolean Boolean data type
Break jumps out of the loop or label code snippet
Byte8-bit Signed data types
A condition for the Caseswitch statement
Catch and try with catch exception information
Char16-bit Unicode character data type
Class Definition Classes
Const not used
Continue do not perform the remainder of the loop body
The default branch in the DefaultSwitch statement
Do Loop statement, the loop body executes at least once
Double64-bit double-precision floating-point number
ElseIf the branch that is executed when the condition is not established
enum Enum type
Extends indicates that a class is a subclass of another class
Final indicates that a value cannot be changed after initialization.
Indicates that a method cannot be overridden, or that a class cannot have subclasses
Finally in order to complete the execution of the code design, mainly for the robustness and integrity of the program, regardless of whether there is no exception to execute code.
Float32-bit single-precision floating-point number
Forfor Loop Statements
Goto not used
If condition statement
Implements indicates that a class implements an interface
Import Imports Class
Instanceof testing whether an object is an instance of a class
Int32 bit integer number
Interface interface, an abstract type, with only the definition of methods and constants
Long64 bit integer number
Native representation method implemented in non-Java code
New to assign a fresh class instance
Package a series of related classes make up a bundle
Private indicates a proprietary field, or method, etc., accessible only from within the class
Protected indicates that a field can only be accessed through a class or its subclasses
Subclasses or other classes within the same package
Public indicates a common attribute or method
Return method returns a value
Short16 bit number
The static representation is defined at the class level, and all instances share the
STRICTFP floating-point comparison using strict rules
Super represents the base class
Switch Selection statement
Synchronized represents a block of code that can only be accessed by one thread at a time
This means that the current instance is called
or call another constructor
Throw throw exception
Throws defines a method that may throw an exception
Transient modifying fields that do not serialize
Try means that the code block is going to do exception handling, or that a finally mate indicates whether throwing an exception executes the code in the finally
void tag method does not return any value
Volatile tag fields may be accessed by multiple threads at the same time without synchronizing
Whilewhile Cycle

12.enxtends:
13.interface:

Java Base Grammer

Related Article

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.