when we have to use final class in java?

Answer Posted / rana

A class is said to be final when i dnt want my class to be
extended by any class so that methods implementation cannot
be changed.
For ex String is a final class

Is This Answer Correct ?    31 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain java coding standards for methods?

804


How do you read and print a string in java?

723


According to java operator precedence, which operator is considered to be with highest precedence?

821


Explain the init method?

726


Why do we declare a class static?

742


Explain spliterator in java8?

783


Explain the difference between hashmap and hashtable in java?

697


Is sizeof a keyword in java programming?

807


Is there any way to find whether software installed in the system is registered by just providing the .exe file? I have tried the following code but its just displaying the directory structure in the registry. Here the code : package com.msi.intaller; import java.util.Iterator; import ca.beq.util.win32.registry.RegistryKey; import ca.beq.util.win32.registry.RootKey; public class RegistryFinder { public static void main(String... args) throws Exception { RegistryKey.initialize(RegistryFinder.class.getResource("jRe gistryKey.dll").getFile()); RegistryKey key = new RegistryKey(RootKey.HKLM, "Software\\ODBC"); for (Iterator subkeys = key.subkeys(); subkeys.hasNext();) { RegistryKey subkey = subkeys.next(); System.out.println(subkey.getName()); // You need to check here if there's anything which matches "Mozilla FireFox". } } }

1538


Which list does not allow duplicates in java?

710


What environment variables do I need to set on my machine in order to be able to run java programs?

784


What are the different access modifiers available in java?

779


What is super?

782


What does replaceall do in java?

679


What is api in java?

744