• 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/

  • 相关阅读:
    使用Android自定义格式的定义Button
    Java Binary Search
    非常成功的人会做的八件事
    Ubuntu12.04 安装java
    NetBeans 时事通讯(刊号 # 125 Nov 17, 2010)
    NetBeans IDE 7.0 Beta 发布
    关于 IPv6 你需要知道的 10 件事
    开始学习 Go
    开始学习 Go
    Quartz 1.8.4 发布
  • 原文地址:https://www.cnblogs.com/vickey-wu/p/8243211.html
Copyright © 2020-2023  润新知