学习日志————java继承多态抽象接口代码(01)

第一天

package day1;
 abstract class L{
	private int age;
	
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public void t() {
		
	}
	public abstract void a();
	public abstract void b();
}
class LL extends L{
	
	public void a() {
		System.out.println(this.getAge());
	}
	public void b() {
		
	}
}
public class Test {
	public static void main(String[] args) {
		LL ll=new LL();
		ll.a();
		ll.setAge(5);
		int b=ll.getAge();
		System.out.println(b);
		ll.a();
	

}}

package day1;
import java.util.Scanner;
import java.util.Collections;
public class Max1 {
    public static void main(String[] args) {
		int n,m,a,b;
		char c;
		Scanner sc=new Scanner(System.in);
		n=sc.nextInt();
		m=sc.nextInt();
		int arr[]=new int[n];
		for(int i=0;iend){
        s = end;
        e = start;
    }else{
        s = start;
        e = end;
    }
    int max = students[s];
    for(int i=s+1;i<=e;i++){
        if(students[i]>max) max = students[i];
    }
    return max;
}}
package day1;

interface A{
	public static final int AGE=50;
	public abstract void b();
}
interface C{
	public static final int LENGTH=100;
	public abstract void d();
}
interface F extends A,C{
	
}
abstract class BB{
	public abstract void print();
}
class B extends BB implements A,C{
	public void print() {
		
	}
	public void b() {
		
	}
	public void d() {
		
	}
}
public class Interface1 {
	public static void main(String[] args) {
		B b=new B();
		b.b();
		b.d();
		System.out.println(A.AGE);
		System.out.println(C.LENGTH);
	}

}

你可能感兴趣的:(学习日志————java继承多态抽象接口代码(01))