//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class M
{
static int i;
static boolean i = true ;
public static void main (String args[])
{
System.out.println("Done");
}
}
14. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class N
{
static int i = 10;
public static void main (String args[])
{
int i = 20;
System.out.println(i);
System.out.println(N.i);
}
}
15. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class O
{
static int i ;
public static void main (String args[])
{
System.out.println(O.i);
O.i = 10;
System.out.println(O.i);
}
}
16. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class P
{
static int i ;
public static void main (String args[])
{
System.out.println(i);
i = 10;
System.out.println(P.i); // class i value
}
}
17. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class Q
{
static int i = 10;
public static void main (String args[])
{
System.out.println(i);
double i = 2.9 ;
System.out.println(i); // method i value print
System.out.println(Q.i); // class i value print
}
}
18. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class R
{
static int i = 10, j = i;
public static void main (String args[])
{
System.out.println(i);
System.out.println(j);
}
}