can we declare private class in java file?

Answer Posted / eknath wagadre

private and static keyword in java we can't use those
keyword any of the outer block. we can use those keyword
only and only inside of the block.(Block i.e Class )

NOTE: Outer class can't be private but inner class can be
private(bcz of this is the part of the outer class and also
inner class can be static.)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the method in java?

854


What are the different approaches to implement a function to generate a random number?

821


Which methods cannot be overridden in java?

769


Difference between this() and super() ?

795


What is the difference between compile-time polymorphism and runtime polymorphism?

790


What is java objectoutputstream?

769


What is a Hash Table? What are the advantages of using a hash table?

867


What is complexity in java?

765


What are unchecked exceptions in java?

843


what is instanceof operator used in java?

798


How many types of literals are there in JAVA?

808


what is ststic with example

1812


Write a function to find out longest palindrome in a given string?

833


how does the run() method in runnable work? : Java thread

716


Explain what access modifiers can be used for variables?

828