255). Which of these keywords is used to refer to member of base class from a subclass?

[A]upper
[B]super
[C]this
[D] none of the mentioned

Show Answer

257). Which of the following statements are incorrect?

[A]String is a class
[B]Strings in java are mutable
[C]Every string is an object of class String
[D]Java defines a peer class of String, called StringBuffer, which allows string to be altered

Show Answer

258). What will be the output of the following Java program?
    class string_demo 
    {
        public static void main(String args[])
        {
            String obj = "I" + "like" + "Java";   
            System.out.println(obj);     
        }
   }

[A]I
[B]like
[C]Java
[D]IlikeJava

Show Answer

259). What will be the output of the following Java program?
    class string_class 
    {
        public static void main(String args[])
        {
            String obj = "I LIKE JAVA";   
            System.out.println(obj.charAt(3));
        } 
    }

[A]I
[B]L
[C]K
[D]E

Show Answer

260). What will be the output of the following Java program?
    class string_class 
    {
        public static void main(String args[])
        {
            String obj = "I LIKE JAVA";   
            System.out.println(obj.length());
        }
    }

[A]9
[B]10
[C]11
[D]12

Show Answer

261). What will be the output of the following Java program?
    class string_class 
    {
        public static void main(String args[])
        {
            String obj = "hello";
            String obj1 = "world";   
            String obj2 = obj;
            obj2 = " world";
            System.out.println(obj + " " + obj2);
        }
    }

[A]hello hello
[B] world world
[C]hello world
[D]world hello

Show Answer

262). What will be the output of the following Java program?
    class string_class 
    {
        public static void main(String args[])
        {
            String obj = "hello";
            String obj1 = "world";   
            String obj2 = "hello";
            System.out.println(obj.equals(obj1) + " " + obj.equals(obj2));
        }
    }

[A] false false
[B]true true
[C] true false
[D]false true

Show Answer