Saturday, December 25, 2010

First Day

  • A literal is a source code representation of a fixed value.
  • There can be only one public class per source file.
  • A source file can have multiple non public classes.
  • The public class name should be the name of the source file as well which should be appended by .java at the end. For example : The class name is . public class Employee{} Then the source file should be as Employee.java .
  • If the class is defined inside a package, then the package statement should be the first statement in the source file.
  • If import statements are present then they must be written between the package statement and the class declaration. If there are no package statements then the import statement should be the first line in the source file.
  • Import and package statements will imply to all the classes present in the source file. It is not possible to declare different import and/or package statements to different classes in the source file.