4. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class D
{
static void test()
{
System.out.println("from test()");
}
static void test(int i)
{
System.out.println("from test(int)");
}
double test(double d)
{
System.out.println("from test(double)");
return d;
}
public static void main(String[] args)
{
test(100);
test();
D d = new D();
d.test(40.5);
System.out.println("Done");
}
}
5. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class E
{
static void test()
{
System.out.println("from test()");
}
static void test(int i)
{
System.out.println("from test(int)");
}
public static void main(String[] args)
{
test(100);
test();
E e1 = new E();
e1.test(40.5);
System.out.println("Done");
}
double test(double d)
{
return d;
}
public int test()
{
System.out.println("from test()");
}
}
6. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class F
{
void test()
{
System.out.println("from test()");
}
double test(int d)
{
return d;
}
public static void main(String[] args)
{
F f1 = new F();
System.out.println( f1.test(40) );
System.out.println("Done");
}
public static void test(double j)
{
System.out.println("static test");
}
}
Page....