zoukankan      html  css  js  c++  java
  • java note

    java note
    1. Java main function must be public static void main(String[] args){}
    2. Class decorator can be public or null. example: public class Main{} or class Main{}
    3. Class name must be the same as file name (and one file only include one class at most), otherwise raise error can't find specific class when call specific class. example: Main.java file include public class Main{} or nothing.
    4. Abstract class: abstract classes are classes that contain one or more abstract methods which don’t have method bodies. example: in public abstract ClassAbstract(){} include method public abstract void methodAbstract();. another class inherit from it. example: public ClassInherit extends ClassAbstract, and implement the abstract method: public void methodAbastract(){ do something };.
    5. Interface class is a 100% abstract class (all method don't have method body). example: public interface InterfaceClass{ public abstract void AbstractOne(); public abstract void AbstractTwo();}. and implement class: class Impl implement InterfaceClass{ public void AbstractOne(){ do something }; }.

    main method: https://stackoverflow.com/questions/29276917/what-does-public-static-void-main-args-mean

    abstract class: https://stackoverflow.com/questions/6007089/how-and-when-to-use-an-abstract-class

    interface class: https://www.sitepoint.com/interface-and-inheritance-in-java-interface/

  • 相关阅读:
    Core Text 实现富文本显示
    音视频直播服务平台总结
    WWDC2017那些事
    Swift网络请求(Moya篇)
    [转贴]孙正耀退休感言
    不要让专业限制了你的高度
    你会搞科研吗?
    上传服务端
    AysnTask+HttpClient实现上传
    TextView改变颜色
  • 原文地址:https://www.cnblogs.com/vickey-wu/p/8243211.html
Copyright © 2011-2022 走看看