DEV Community

hema latha
hema latha

Posted on

Employee task

public class Employee {

  1. Create a class 'Employee'
  2. Have main method in it.
  3. Inside main method, create an object.
  4. Using this object, call method called 'develop'.
  5. using this object, call method called 'work(10)'
  6. Define appropriate methods develop() and work(int no)
  7. From work method, return no * 10
  8. Store the returned value as 'output' in main method.
  9. Print the 'output'.

public class Employee {
public static void main(String[] args) {
// TODO Auto-generated method stub
Employee vasu = new Employee();
vasu.develop();
int num = vasu.work(10);
System.out.println(num);
}
public void develop()
{

}

public int work(int no)
{
return no*10;
}
}

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more