Java Fundamentals Deepen

Source: Internet
Author: User

1: Variable
    • Member variable-{instance variable, static variable}
    • Local variables
2: Arrays and strings
    • The array length is immutable and the data type must be the same
    • String
    • Constructor method String (char a[]): Char a[]={', ', ', ', ', '},string s= new String (a);
    • Direct initialization: String s= "Sssssssss";
    • Array
    • Statement: type name [];
    • Initialization
      • The space can be allocated first without the =new type [numeric value], such as int month=new int[12];
      • Construction method =new type []{x,x,x,x,x};
    • Direct initialization of ={x,x,x,x,x};
Arrays class static method call for loop (type variable: loop array name) {}; 3: Syntax
    • Static
      • The static method cannot call a non-static property, and the static property can be called by a non-static method
      • Static code block
    • Final
    • Interface
    • Packaging
1:set method Set value, get method return value--method Public2: Class variable, method, constructor method private, create static final class object in Class =new class (); ___ Singleton mode
    • Inherit extends
      • The default inherits the properties and methods of the parent class public, implicitly inheriting private, and prohibiting subclass access
      • Method and property with the same name override, to subclass first
    • Polymorphic
      • Parent class object =new subclass instantiation (); Down transformation
      • Subclass up to parent class (cast)
    • Abstract class Interface
      • Abstract class
      1. Just declare, not new
      2. The abstract Class+abstract Method (parameter) has no entities;.
    • Interface
      • Interface Interface Name
      • The member must be instantiated (the initial value of the overlay), all constant final
      • There can only be abstract methods
      • Implement interface implements interface A, interface B, interface C,,,,,,,,
      • Interfaces can inherit multiple interfaces to implement extensions (unlike General class single inheritance)
    • Inner class
4: Scope of Access

Java Fundamentals Deepen

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.