package abstractpkg;
interface intrface {
// interface içinde public
// modifier kullanılabiliyor.
public int intrfaceMetot_1();
void intrfaceMetot_2();
//C#tan farklı olarak normal/static
//sabit tanımlanabiliyor
final int yas = 10;
}
interface intrface1 {
int intrface_1_metot();
}
abstract class abs {
abstract void absMetot();
void absMetot_2(String s1){
// birşeyler yapsın
// anlayalımki abstractlerin
// bodyli metotları da olduğunu
}
}
abstract class abs1 extends abs implements intrface, intrface1 {
public String sdegisken;
abstract void abs_1_Metot();
}
class cls extends abs1 {
@Override
void abs_1_Metot() {
}
@Override
void absMetot() {
}
public int intrfaceMetot_1() {
}
public void intrfaceMetot_2() {
}
public int intrface_1_metot() {
}
}
class clsInterfaceten implements intrface,intrface1{
public int intrfaceMetot_1() {
}
public void intrfaceMetot_2() {
}
public int intrface_1_metot() {
}
}
public class Main {
public static void main(String[] args) {
}
}
Interface kullanımına güzel bir örnek: http://www.sourcecodesworld.com/articles/java/java-data-structures/Comparing_Objects.asp