Core Java- Bangla Tutorial(Nested Classes)- Class 26

preview_player
Показать описание
Nested Classes in Java
Рекомендации по теме
Комментарии
Автор

Sir you said, we can't create object of a Interface or abstract class ... so why we create an object of a interface .

interface Eatable {
void eat();
}
public class TestAnonymousInner1(
public static void main(String args[]){
Eatable e = new Eatable(){ // here we create a object of a interface
public void eat(){
System.out.println("Nice Fruits");
};
e.eat();
}
}
)

shahariarkabir
Автор

Sir you said that local inner class cannot access non final local variable
but sir In my NetBeans if i use non final local variable ... there is no error showing to access non final varibale

shahariarkabir
visit shbcf.ru