Core Java : Proficients


1. Which keyword can be used in the subclass to call the constructor of the superclass?




2. What of the following is supported by method overrding in java?




3. Which class is superclass of every class in java?




4. Which class is the superclass of String and StringBuffer class?




5. What will be the output of the code ________?


    class Alligator_test 

	    {

            public static void main(String args[]) 
            
	            {

                        int []x[] = {{4,5}, {6,7,8}, {9,10,11,12}};

                        int [][]y = x;

                        System.out.println(y[2][3]);

	            }
	    }



6. What will be the output of the code ________?


    final class X
    
        {

            int i;

        }

    class Y extends X 
        
        {

            int j;

            System.out.println(j + " " + i); 

        }

    class inheritance

        {
            
            public static void main(String args[])

                {

                    Y obj = new Y();

                    obj.display();   

                }
        }



7. What will be the output of the code ________?


    class String

	    {

            public static void main(String args[])
            
	        {

                    char chars[] = {'x', 'y', 'z'};

                    String s = new String(chars);
                    
                    System.out.println(s);
                }
                
	    }



8. Which of the following is correct regarding concatination of two or more string objects?




9. StringBuffer class uses __________ method to get the length of sequence of characters?




10. What will be the output of the code ________?


    class string 

	    {

                public static void main(String args[])
            
                { 

                    StringBuffer s1 = new StringBuffer("hello");

                    s1.insert(1,"minigranth");

                    System.out.println(s1);

                }
	    }