Java Basic Syntax Essentials Summary

Source: Internet
Author: User
Tags modifier

1. Variable format: variable name of data type = initialization value;

Class Name Object name =new class name ();

2. Reference data type class interface array

3. Automatic conversion of data type conversions

Cast: int i= (int) 1.5

4. Method: is a piece of code, you can complete a specific function

Can be called repeatedly to improve the reusability of code

Modifier return value type method name (parameter list) {code ... }

5. Loop structure for (initialization expression; Boolean expression; stepping expression) {loop body}

While

6. Array array type [] array name =new data type [length]

Array type [] array name =new data type []{element 1 .... } data type [] array name ={element 1 ... }

7. Create object class name Object name =new class name ();

8. Constructor method Modifier constructor Method name (parameter list) {method body}

9. Inheritance modifier abstract return value type method name (parameter list)

10 Abstract Class class name

11. Interface public interface Name {}

Java Basic Syntax Essentials Summary

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.