Saturday, July 22, 2023

Function Overloading using JAVA ( Method 1 )

 public class FunctionOverloading1 {

    void f()
    {
        System.out.println("this is without parameter");
    }
    void f(int x)
    {
        System.out.println("this is integer parameter");
    }
    void f(double x)
    {
        System.out.println("this is double parameter");
    }
    void f(char x)
    {
        System.out.println("this is character parameter");
    }

    public static void main(String[] args) {
        FunctionOverloading1 ob=new FunctionOverloading1();
        ob.f();
        ob.f(5);
        ob.f(10.5);
        ob.f('a');
    }
}

No comments:

Post a Comment

A physicist confesses that the electron is round and that Jesus rose from the dead. (Bengali)

একজন পদার্থবিজ্ঞানী স্বীকার করেন যে ইলেকট্রন গোলাকার এবং যিশু মৃতদের মধ্য থেকে পুনরুত্থিত হয়েছিলেন। আমার নিজের বিশ্বাস প্রমাণ দ্বারা প্রভাব...