Subclass exhas a tendency SuperClass. So, calling super.finalize() is valid because finalize technique for object have the right to be referred to as from some other course external the package with inheritance.

You are watching: Why finalize method is protected in java

finalize technique for object can’t be called from some other class external the package without inheritance

MyClass1 does not extends MyClass2. So, calling finalize() approach by producing circumstances of MyClass1 in MyClass2 is invalid (any attempt to do so will certainly reason compilation error) because finalize approach for object can’t be referred to as from some other course outside the package without inheritance.


last keyword in java - 20 salient features

finalize technique in java - 13 salient features


Algorithm(34)Apache Tomcat Server(4)Arrays Java(30)Autoboxing(5)Basic java programs for beginners(15)Binary Trees(6)Collection Framework(68)Collection programs(105)Collections implementation(16)Comparable and also Comparator program(22)Core Java(1035)core java Basics(38)Core java Conversions(21)Core Java Differences(11)Core Java Tutorials(12)CRUD MongoDB java(5)CRUD operations MongoDB(3)Custom implementation of Data Structures(11)Documents Structure(26)Database(1)Database Tutorials(3)Date tutorials(11)DeSerialization(19)eclipse(27)Exam java(33)Exceptions(71)File IO/File handling(71)Garbage arsenal in java(43)Generics(5)Hashing(8)Hibernate(1)Intersee questions(14)iText Pdf tutorial(45)Java 4(1)java 5(3)Java 7(32)Java 8(80)Java 9(12)Java keywords(11)Java Mcq(Multiple choice questions)(5)Java Programs(8)Java QUIZ(24)JavaScript(28)JDBC(74)JSON(27)JUNIT(7)JVM(22)JVM parameters(10)Level1 programs (beginners)(34)Level2 programs (intermediate)(23)Level3 programs (advanced)(13)Linked List(15)Linux(7)Matrix programs(10)Maven(6)MongoDB(87)MongoDB Java(20)MS Excel(44)MsSql(1)MultiThreading(97)MySql(7)Nashorn Javamanuscript (js) Engine in Java 8(26)Notepad++(6)Oracle(18)OutOfMemoryError(13)Overriding amounts to and also hashCode(11)Pattern generating(14)PostgreSQL(1)Producer Consumer problem/pattern(10)Pyramid generation(14)Recursion(10)RegEx(7)SCJP(26)Serialization(20)Serialization peak interwatch inquiries and answers in java(18)Thcheck out Concurrency(35)Threads(73)TUTORIALS(22)UNIX(1)Windows(8)

See more: What Color Nail Polish With A Black Dress ? 83 Best Nails For Black Dress Ideas

► 2020(1)► 2018(114)► 2017(211)► 2016(240)► 2015(722)

Please enable JavaScript!Bitte aktiviere JavaScript!S"il vous plaît activer JavaScript!Por favor,activa el JavaScript!