flp exam

Upload: suraj-ghimire

Post on 02-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 FLP EXAM

    1/3

    1.What will be the ouput of the following code

    final int i =125; byte b = i ;

    System. out .println( b );

    2.What is the output of the following code

    float f =2.3f;System. out .println(( f ==2.3)?5.0:10);

    3.The following code fails to compile.Find out why?

    for ( int i =0; i

  • 8/11/2019 FLP EXAM

    2/3

  • 8/11/2019 FLP EXAM

    3/3

    public class Test6 extends Parent5{ public static void main(String[] args ) {

    Child6 child =new Child6();System. out .println( child . x );System. out .println( child . y );System. out .println( child . z );

    child .show1();child .show2();child .show3();

    Parent6 parent = new Child6();System. out .println( parent . x );System. out .println( parent . y );//System.out.println(parent.z); parent .show1();parent .show2();//parent.show3();

    //Child6 child2=new Parent6();

    }}