DEV Community

yaswanth krishna
yaswanth krishna

Posted on

Object Class and Method Creation

`package basic_start;

public class teaching {
    public static void main(String[] args) {
        teaching teach = new teaching();
        teach.tech();//{
        teach.trainner();//    method calling statements }
        teach.math(10,2);
    }// complete them main method

    public void tech() {             // its method callfare
        System.out.println("teaching");
    }
    public void trainner() {
        System.out.println("trainner");
    }
    public void math(int no1,int no2) {    // if use calling method 10,2 
                                           // you write a method  inside a
                                           // (int no1,int no2)you will add callfore
        System.out.println(no1+no2);
    }

}
`
Enter fullscreen mode Exit fullscreen mode

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

👋 Kindness is contagious

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

Okay