Skip to main content

Java Day 2

 

DAY 2

  1. Choose the correct output among the following options.
  2. import static java.util.Arrays.toString;

    class Main{
        public static void main(String[] args) {
            printArgs(1,2,3,4,5);
        }
        static void printArgs(Object... args){
            System.out.println(toString(args));
        }
    }
    1. Actual and formal argument lists differ in length, compile time error.
    2. Syntax error
    3. [1,2,3,4,5]
    4. 1-2-3-4-5@e234545
  3. Choose the correct output among the following options.
  4. /**
     * Generated by DC Sharma.
     * from E:TestRoot\apps\units\include\Alpha.dll
     * Date: April 27, 2023
     */

    class T{
        public static void main(String[] args) {
            System.out.print("Hell");
            System.out.println("o class");
        }
    }
Prev Next

Comments