- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
USE OF FINAL KEYWORD WITH CLASS IN JAVA in Hindi Lecture 73
//Java final Class
A class declared with final keyword is known as final class.The final class cannot be inherited.
Syntax-----
final class student
{
//statement
}
Example----
final class student
{
public void show1()
{
System.out.println("parent class method");
}
}
//we cannot inherit the final class
class person extends student
{
public void show2()
{
System.out.println("child class method");
}
}
class example
{
public static void main(String args[])
{
person obj=new person();
obj.show1();
obj.show2();
}
}
When we compile the above code it shows a compile time error as the final class cannot be inherited.
//Java Keyword:Java final class
//show error as final class cannot be inherited
final class student
{
public void show1()
{
System.out.println("parent class method");
}
}
class person extends student
{
public void show2()
{
System.out.println("child class method");
}
}
class example
{
public static void main(String args[])
{
person obj=new person();
obj.show1();
obj.show2();
}
}
Видео USE OF FINAL KEYWORD WITH CLASS IN JAVA in Hindi Lecture 73 канала Learning Language
A class declared with final keyword is known as final class.The final class cannot be inherited.
Syntax-----
final class student
{
//statement
}
Example----
final class student
{
public void show1()
{
System.out.println("parent class method");
}
}
//we cannot inherit the final class
class person extends student
{
public void show2()
{
System.out.println("child class method");
}
}
class example
{
public static void main(String args[])
{
person obj=new person();
obj.show1();
obj.show2();
}
}
When we compile the above code it shows a compile time error as the final class cannot be inherited.
//Java Keyword:Java final class
//show error as final class cannot be inherited
final class student
{
public void show1()
{
System.out.println("parent class method");
}
}
class person extends student
{
public void show2()
{
System.out.println("child class method");
}
}
class example
{
public static void main(String args[])
{
person obj=new person();
obj.show1();
obj.show2();
}
}
Видео USE OF FINAL KEYWORD WITH CLASS IN JAVA in Hindi Lecture 73 канала Learning Language
Комментарии отсутствуют
Информация о видео
28 мая 2026 г. 11:36:59
00:03:43
Другие видео канала




















