The following java program is to accept slides of a triangle and display the type of triangle. fill in the blank with appropriate java statement. use the following specifications Class name : triangle member variables : int a int b int c class(a)________ { void main (string args[]) throws 10 exception } int a,b,c ; System.out.println (''enter 3 sides if a triangle ''); a= integer.parseInt (b)_______ b=(c)_________ c=(d)______ if ((a==b) && (e)______) System.out.println (''equilateral''); if ((a==b) ll (b==c) ll (f)_____) System.out.println (''isosceles''); else if ((al = b) &&(bl=c) &&(cl=a)) System.out.println (''scalene ''); } }
Answers
Answered by
0
Answer:
Explanation:
interface MyInterface
{
/* compiler will treat them as:
* public abstract void method1();
* public abstract void method2();
*/
public void method1();
public void method2();
}
class Demo implements MyInterface
{
/* This class must have to implement both the abstract methods
* else you will get compilation error
*/
public void method1()
{
System.out.println("implementation of method1");
}
public void method2()
{
System.out.println("implementation of method2");
}
public static void main(String arg[])
{
MyInterface obj = new Demo();
obj.method1();
}
}
Similar questions