DEV Community

Guna Sekaran
Guna Sekaran

Posted on

1

Java day 10

Today task:
Test:

  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'.

10) What is Object?  How do you create Object in Java?
11) What is method?  How do you create Method in Java?
12) Why do we need static keyword in Java?
13) Write few Java Keywords you know.

PROGRAM:

Image description

OUTPUT:

Image description

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay