DEV Community

hema latha
hema latha

Posted on

Default package task

package Shop_owner;

public class Shop_owner
{
public static void main(String[] args)
{
Shop_owner arun = new Shop_owner();
arun.cleaning();
arun.profeat();
}
void cleaning()
{
System.out.println("shop_cleaning");
}
void profeat()
{
System.out.println("monthly_profeat");
}
}

another package and another one class create

package Opposite_shopowner;

import Shop_owner.Shop_owner;

public class Oppisite_shopowner {
public static void main(String[] args) {
Shop_owner arun = new Shop_owner();
arun.cleaning();
arun.profeat();

}
}

out put -- Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method cleaning() from the type Shop_owner is not visible
The method profeat() from the type Shop_owner is not visible

Top comments (0)