Static, Keywords: static interface, IUSB, API interface keyword: interface

Source: Internet
Author: User
Tags iusb

//static//normal member//normal member is a//static member///static member belongs to the class//keyword: static//self keyword: In the class represents the class//In the static method cannot call the ordinary member//in the ordinary method can call static member//.$ This represents the object that needs to be called with the object and cannot be called with the class name! Illustrates a situation in which a normal member cannot be called in a static methodclassfenbi{ Public $length;//the length of the chalk     Public Static $color;//the color of the chalk        Static functionShow () {Echo"Chalk color is:". Self::$color; }        functionXianshi () {Echo"Show:". Self::$color; }}$f=NewFenbi ();//create an object first$f->length;//use objects to invoke ordinary membersFenbi::$color= "Red";//calling a static member using the class nameFenbi::Show ();$f-Xianshi ();//Abstract//abstract class: Keyword abstract//features: Can not be instantiated, can only be inherited//purpose: In order to derive subclasses, the control sub-classAbstract classdog{ Public $name; functionJiao () {EchoBarking; }}classJinmaoextendsdog{}//$d = new Dog ();//interface///interface cannot contain member variables, only member methods//Member methods can have no function body//interface keyword: interface//implements the interface class, must implement all the methods inside the interfaceInterfaceiusb{functionRead ();//Read the method    functionWrite ();//How to write}//Mouse Driver ClassclassMouseImplementsiusb{functionRead () {Echo"Mouse clicked"; }    functionwrite () {Echo"Give the Mouse an instruction"; }}//driver classes for keyboardsclassJianpanImplementsiusb{functionRead () {Echo"Keyboard entered the content"; }    functionwrite () {Echo"Give keyboard Instructions"; }}$m=NewMouse ();$m-write ();$j=NewJianpan ();$j-read ();//Interface: API

Static, keyword: static interface, IUSB, API interface keyword: interface

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.