public class Employee {
- Create a class 'Employee'
- Have main method in it.
- Inside main method, create an object.
- Using this object, call method called 'develop'.
- using this object, call method called 'work(10)'
- Define appropriate methods develop() and work(int no)
- From work method, return no * 10
- Store the returned value as 'output' in main method.
- 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)