DEV Community

Guna Sekaran
Guna Sekaran

Posted on

Today task

Task:

  1. Create a class Called Player
  2. Have main method in it.
  3. Inside main method, create an instance(object) called 'dhoni'.
  4. Using 'dhoni' reference, call a method called 'batting(30)'
  5. From batting, return 100
  6. Store returned value as score.
  7. Print returned value in main method.

CODE:

Image description

Output:

Image description

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

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

Okay