Java Test

package com.lara;

abstract class B

{

private int test()

{

return 90;

}

public abstract void test1();

protected abstract String snoochy(String str);

}

public class Manager1 extends B

{

protected int test()

{

return 100;

}

@Override

public String snoochy(String str)

{

System.out.println(str);

return "Like";

}

@Override

public void test1()

{

System.out.println("test1-Manager1");

}

public static void main(String[] args)

{

Manager1 m1=new Manager1() ;

String str=m1.snoochy("lara");

System.out.println(str);

m1.test();

m1.test1();

}

}


package com.lara;

class Foo

{

int i;

public Foo()

{

i=90;

}

public void addFive(int i)

{

i=100;

}

}

class Foo2 extends Foo

{

int I;

public Foo2()

{

i=67;

}

public void addFive(int i)

{

i=65;

System.out.println("Foo2-addFive");

}

}

public class Manager1

{

public static void main(String[] args)

{

Foo f1=new Foo2();

f1.addFive(10);

System.out.println(f1.i);

Foo2 f2=new Foo2();

f2.addFive(30);

System.out.println(f2.i);

package com.lara;

class P { int i=10;}

class Q extends P { int i=20;}

public class Manager1

{

public static void main(String[] args)

{

P p=new Q();

System.out.println(((Q)p).i);

System.out.println(p.i);

Q q1=new Q();

System.out.println(q1.i);

}

}


public class D

{

public static void main(String[] args) {

int d=(int) test( (short) 10);

System.out.println(d);

}

static double test(int i)

{

return 70;

}}


public class Manager3

{

public static void main(String[] args)

{

int x=0;

int y=10;

do

{

y--;

++x;

}while(x<5);

System.out.println(x+","+y);

}

}

What is the result?


public class Manager3

{

public static void main(String[] args)

{

int x=12;

while(x<10)

{

x--;

}

System.out.println(x);

}

}

What is the result?


public class Manager3

{

public static void main (String [] args)

{

int i;

System.out.println('i');

System.out.println(i=10);

}

}


























































































































































































































































































Description:

this test test your knowledge in java and based on this u will try to develop your knowledge technically.If any body has any doubt about this test or technically please contact me and i will give you best way how to learn java and Mainly you must learn core Java after then J2ee concepts like JDBC,Servlets,Jsp these are very easy to learn if u don't have any knowledge of c or c++ languages

Discussion
2 Followers
Test: 1

Your Facebook Friends on WizIQ