package com.example.demo
public interface Generic<T>{
void get(T t)
}
GenericImpl.java:
package com.example.demo
public class GenericImpl<T>缺亏并空腊 implements Generic<伏迹T>{
@Override
public void get(T t) {
}
}
interface Vehicle {public void Start(String s)
public void stop(String s)
}
class Bike implements Vehicle {
@Override
public void Start(String s) {
System.out.println(s + " bike start")
}
@Override
public 老凳搏void stop(String s) {
System.out.println(s + " bike stop")
}
}
class Bus implements Vehicle {
@Override
public void Start(String s) {
System.out.println(s + " bus start")
}
@Override
public void 粗蔽stop(String s) {
System.out.println(s + " bus stop")
}
}
class interfaceDemo {
public static void main(String[] args) {
Bike bike = new Bike()
bike.Start("My")
bike.stop("My")
Bus bus = new Bus()
bus.Start("My")
bus.stop("侍祥My")
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)