15. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class O
{
final int i = 10;
public static void main(String[] args)
{
O o1 = new O();
o1.i = 10;
System.out.println("done");
}
}
16. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class P
{
int i = 100;
public static void main(String[] args)
{
final P p1 = new P();
p1.i = 50;
System.out.println("done");
}
}
17. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class Q
{
final int i = 10;
void test()
{
i = 10;
}
}
18. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class R
{
final int i = 10;
R()
{
i = 10;
System.out.println(i);
System.out.println("Done");
}
}
19. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class S
{
final int i = 10;
{
i = 10;
}
public static void main(String[] args)
{
System.out.println(i);
}
}
20. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class T
{
final int i;
//final variable must be initialized.
}
21. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class U
{
final int i = 0;
}
Page....