Computer Applications

Given the method below, write a main() method that includes everything necessary to call given method.

int thrice (int x)
{
return x * 3 ;
}

User Defined Methods

16 Likes

Answer

public class Methodcall
{
    int thrice (int x)
    {
        return x * 3 ;
    }
    
    public static void main(String args[])
    {
		Methodcall obj = new Methodcall();
        int ans;
        ans = obj.thrice(5);	
    }
}

Answered By

10 Likes


Related Questions