DEV Community

hema latha
hema latha

Posted on

Default method

package tamilnadu.chennai;

public class IT_Company {

public static void main(String[] args) {
// TODO Auto-generated method stub
IT_Company software_engineer = new IT_Company();
software_engineer.develop();
software_engineer.test();

}
void give_snacks()
{
System.out.println("Snacks / Tea / Coffee ");
}
public void work_from_home()
{
System.out.println("Work From Home");
}

private void develop()
{
System.out.println("Development");
}
private void test()
{
System.out.println("Testing");
}

}

another class
package tamilnadu.erode;

import tamilnadu.chennai.IT_Company;

public class Employee {

public static void main(String[] args) {
// TODO Auto-generated method stub
IT_Company emp = new IT_Company();
emp.work_from_home();
//emp.give_snacks();

}

}

output = errer : The method work_from_home() from the type IT_Company is not visible

Top comments (0)