首先是 eclipse 的使用
其次是 PTA 里面 Java 的格式
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s=new Scanner(System.in);
- int n=s.nextInt();
- int a[]=new int[n];// 数组的创建
- for(int i=0;i<n;i++) {
- a[i]=s.nextInt();// 输入
- }
- System.out.print(j+" "+o);// 输出
- }
- }
Java 父类对象调用子类实体: 方法重写与动态调用 https://www.cnblogs.com/cielosun/p/6580871.html
- class Father{
- public void announce(){
- System.out.println("Father");
- }
- }
- class Child extends Father{
- @Override// 覆盖
- public void announce(){
- System.out.println("Child");
- }
- }
- public class Hello {
- public static void main(String[] args){
- System.out.println("Hello");
- Father father=new Child();
- father.announce();
- }
- }
- https://www.cnblogs.com/cielosun/p/6580871.html
- http://www.voidcn.com/article/p-mgphykic-cb.html
- https://www.cnblogs.com/qbdj/p/10869931.html
来源: http://www.bubuko.com/infodetail-3366718.html