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
Can a class extends itself in java?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
Why is string builder not thread safe?
What happens if we override only equals?
Why do we need autoboxing in java?
What are the types of collections in java?
If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?
Can you inherit from an abstract class java?
What is garbage collector?
What is the difference between stringbuffer and stringbuilder class?
Are global variables initialized to zero?
Why is core java important?
What is a flag value?
What is the use of using enum to declare a constant?
What is the output of the below java program?