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/

  • 相关阅读:
    JavaScript备忘录-逻辑运算符
    CMake 构建项目教程-简介
    C++ 跨语言调用 Java
    Thrift-0.10.0 CenOS 7 编译错误 error: expected ')' before 'PRIu32'
    CentOS 7 安装 MySQL Database
    CentOS 安装 Wine
    FreeBSD 配置
    CentOS 6.5 升级 GCC 4.9.3
    Favorite Setting
    shell编程-1到100的求和与冒泡排序
  • 原文地址:https://www.cnblogs.com/vickey-wu/p/8243211.html
Copyright © 2011-2022 走看看