Packages are nothing directory of our file system that exist our file system they contain set of class file
package AllBoy;
public class Student{
public static void main(String args[]){
System.out.println("Student are playing");
}
}
javac -d directory javafilename
class Fruit{
final void run(){System.out.println("eating");}
}
class Apple extends Fruit{
void run(){System.out.println("it is very costly");}
public static void main(String args[]){
Apple a= new Apple();
a.run();
}
}
final class A
{
}
class B extends A
{
}
final class Fruit{}
class Apple extends Fruit{
void run(){System.out.println("It is very costly");}
public static void main(String args[]){
Apple a= new Apple();
a.run();
}
}