OO Pilot Course--java the Knowledge collection of the beginning of the Meng

Source: Internet
Author: User

Common operations

Array

// Declaration * Array is also an object, length is an attribute int [] i=newint[5]; int [] i={0,1};  String[] str=newstring[5]; // string array, double quotation marks, distinguished from char character array String [] str={"A", "B"};

//Find the length array at the beginning , the length is determined (just a property, ' \ ' is useless)
Reference: http://www.cnblogs.com/entry-android/p/5539362.html
N=charset.length;

Array of strings

The length does not end with a terminator;

Inherited


Basic operations

// inheritance, only construction methods cannot be inherited  Public class  extends box{    publicdouble scale ;      Public Scalebox (double W,double h,double D,double  f) {          Super(W*F,H*F,D*F); // Direct use of the box construction method, must be the first line, first constructed to use        Scale=F;}

Method overloading

same name, but with different parameters and different definitions

Method Overrides (Overwrite)

Like the name, the return value is the same as the parameter, and in the subclass it is a new subclass of the child class, and the original method of the parent class cannot be used.

  

OO Pilot Course--java the Knowledge collection of the beginning of the Meng

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.