It may be a repeated question. But i need a clear answer for this answer. I am so confused.
For EG: I have class to display time.
import java.util.Date;
**public** class DateDisplay {
public static void main(String[] args) {
Date today = new Date();
System.out.println(today);
}
}
None of the class in the same package is going to extend this class. Why can not i declare a class at private?
Why JAVA is not allowing me to declare a class as private? What is the reason behind this?
My second question is where should i use inner class? What is purpose of inner class?