Code :
interface I1
{
public void comppute1();
}
interface I2 extends I1
{
public void compute2();
}
Output :
Code :
interface I1
{
public void comppute1();
}
interface I2 extends I1
{
public void compute2();
}
Output :
Code :
interface I1
{
void compute1();
}
class B implements I1
{
public void compute1()
{
System.out.println("Computed Output");
}
}
class Main
{
public static void main()
{
B B1 = new B();
B1.compute1();
}
}
Output :
Code :
#include<iostream>
using namespace std;
int volume(int);
double volume(double,int);
long volume(long,int,int);
int main()
{
cout<< volume(10)<<endl;
cout<< volume(2.5,8)<<endl;
cout<< volume(100,75,15)<<endl;
return 0;
}
int volume(int s)
{
return(s*s*s);
}
double volume(double r,int h)
{
return(3.14519*r*r*h);
}
long volume(long l,int b,int h)
{
return(l*b*h);
}
Output :
Code :
class SquareRoot
{
public static void main(String args[])
{
double x = 5; // Declaration and initialization
double y; // Simple declaration
y = Math.sqrt(x);
System.out.println("y = " + y);
}
}
Output :
Code :
class SampleOne
{
public static void main(String args[])
{
System.out.println("Hello World");
}
}
Output :