# void windowActivated(WindowEvent e); # void windowClosed(WindowEvent e); # void windowClosing(WindowEvent e); # void windowDeactivated(WindowEvent e); # void windowDeiconified(WindowEvent e); # void windowIconified(WindowEvent e); # void windowOpened(WindowEvent e);
First of all, it only has to be the same when the class is public. And there is no explicit reason for that, it's just a convention that came along with old versions of java and people got used to it... They say it's because of the limited capabilities of the compiler to compile dependencies. When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true: * The type is referred to by code in other compilation units of the package in which the type is declared. * The type is declared public (and therefore is potentially accessible from code in other packages). This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory. When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units. It is not mandatory to say "file name equals to classname". > U can give your own name to your filename [ other than classname ] > at the time of compilation you just give your filename[other than classname] > After compilation you will get .class file with your class name.[classname.class] >.But at the time of loading ur program into JVM u just have to give the class name , This is possible even the main() is public/private. for eg:-consider have created a program in java with file name Ashish n class name is batra,now at the time of compilation u have to write "javac ashish.java" at the command prompt and at the same time the jvm create the .class object in the bin directory with filename =batra(batra.class) .Now at the time of running the program u have to write "java batra" at the command prompt. We say this statment that the file name should be same as the class name to make sure there is no confusion while compiling n running the program .Consider u have created many programs in java and now u want to run any one of them ,then it would be very difficult for u to recall the class name of that particular program .So to make it a simpler we offenly say that the class name should be same as the file name.
It is a method in System.out that prints the parameter to the screen.
i.e. System.out.println("Hello World"); // prints Hello World.
Inheritance is a concept in java that will achieve super class properties inside of base class
called inheritance means we inherits data from parents class to chiled class
An annotation is a note that is made while reading any form of text.