ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

CP1344: PROGRAMMING IN JAVA - LECTURE -40- FINALIZER METHODS- BCA- S3.

Finalizer Methods

Abstract Methods

Автор: BOSCOCAMPUSVISION

Загружено: 2020-08-19

Просмотров: 107

Описание: Finalizer Methods

We have seen that a constructor method is used to initialize an object when it is declared. This process is known as initialization, Similarly, Java supports a concept called finalization, which is just opposite to initialization. We know that Java run-time is an automatic garbage collecting system. It automatically frees up the memory resources used by the objects. But objects may hold other non-object resources such as file descriptors or window system fonts. The garbage collector cannot free these resources. In order to free these resources we must use a finalizer method. This is similar to destructors in C++.
The finalizer method is simply finalize( ) and can be added to any class. Java calls that method whenever it is about to reclaim the space for that object. The finalize method should explicitly define the tasks to be performed.
Abstract Methods and Classes

We have seen that by making a method final we ensure that the method is not redefined in a subclass. That is, the method can never be subclassed. Java allows us to do something that is exactly opposite to this. That is, we can indicate that a method must always be redefined in a subclass, thus making overriding compulsory. This is done using the modifier keyword abstract in the method definition.
Example:

abstract class Shape
{
abstract void draw( );
}
When a class contains one or more abstract methods, it should also be declared abstract as shown in the example above.

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
CP1344: PROGRAMMING IN JAVA - LECTURE -40- FINALIZER METHODS-  BCA- S3.

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]