can we declare private class in java file?

Answer Posted / ranganathkini

A class can be marked by the "private" access specifier only
if its a nested member of another class.

Top level classes cannot be marked as "private". Hence you
can have private classes in a java file but they must be
nested inside another class.

Is This Answer Correct ?    208 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Wha is the output from system.out.println(“hello”+null); ?

683


What is a bubble sort in java?

537


What is the escape character in java?

505


What exactly is a .class file?

570


Is null false in java?

701






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". } } }

1342


What do you mean by formatting?

536


How does remove work in java?

513


What is string builder in java?

552


What is method in research paper?

569


What is the parse method in java?

555


How can an exception be thrown manually by a programmer?

503


What is bean? Where it can be used?

595


Is null a keyword in java?

551


Is hashset ordered?

542