Default class access may trigger some error which the compiler complain about the source.

  • package 1

  • package car;
    class BMW { }

  • package 2

  • package utils;

    class Tool extends BMW {}

    second package creates a new class which extends the “BMW” class. But the first class definition has no any access specifier so the access permissions are set to default. Default access is the package level access which the second package must be in the same package with “car” or you can define “BMW” class with public.

  • Package 1

  • package car;
    class BMW { }

  • Package 2

  • package car.utils;

    class Tool extends BMW {}

    OR

  • Package 1

  • package car;
    public class BMW { }

  • Package 2

  • package utils;

    class Tool extends BMW {}

    Buy me a beer

    Related posts:

    1. Managing Access with CVS If we have a look at the permissions in our...
    2. Maxtor Delivers Secure Remote Access to Your Shared Storage From any Web Browser LAS VEGAS-Seagate (NYSE: STX) announced at CES a free software...
    3. Sony Computer Entertainment America to Give Gamers Unprecedented Access with Qore™: Presented by PLAYSTATION®Network Sony Computer Entertainment America (SCEA) today announced that on June...