what problem in this java code cant find the main, can you check code package EmployeePersonal; //create a Driver class public class Driver { //Define main() method public static void main(String[] args) { //create object for sub class "Employee" Employee obj=new Employee(); //Call the super class member function setName() using object of sub class "Employee" obj.setName("David"); //Call the super class member function setAge() using object of sub class "Employee" obj.setAge(35); //Call the super class member function setAddress() using object of sub class "Employee" obj.setAddress("Chicago"); //Call the super class member function setPhone() using object of sub class "Employee" obj.setPhone(25648713); //Call the function to set employeeid obj.setEmployeeID(100); //Call the function to set department obj.setDepartment("Plumbing"); //Call the function to set salary obj.setSalary(15000); //Call the function to display personal details obj.diaplayPersonalDetails(); //Call the function to display employee details obj.diaplyEmployeeDetails(); } }
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
what problem in this java code cant find the main, can you check code
package EmployeePersonal;
//create a Driver class
public class Driver {
//Define main() method
public static void main(String[] args)
{
//create object for sub class "Employee"
Employee obj=new Employee();
//Call the super class member function setName() using object of sub class "Employee"
obj.setName("David");
//Call the super class member function setAge() using object of sub class "Employee"
obj.setAge(35);
//Call the super class member function setAddress() using object of sub class "Employee"
obj.setAddress("Chicago");
//Call the super class member function setPhone() using object of sub class "Employee"
obj.setPhone(25648713);
//Call the function to set employeeid
obj.setEmployeeID(100);
//Call the function to set department
obj.setDepartment("Plumbing");
//Call the function to set salary
obj.setSalary(15000);
//Call the function to display personal details
obj.diaplayPersonalDetails();
//Call the function to display employee details
obj.diaplyEmployeeDetails();
}
}

Step by step
Solved in 2 steps









