MCQ Questions
Q.1.
Rearrange the following code so that it forms a correct program that prints out the letter Q:
  • 0%
    public static void main( String [] args ) { System.out.println( "Gershwin, George" ); System.exit( 0 ); }
  • 0%
    public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }
  • 0%
    public class Hello{ public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }}
  • 0%
    public class Q {public static void main(String[] a) {System.out.println("Q"); }}
Q.2.
Write a complete main method that prints Hello, world to the screen.
  • 0%
    public static void main( String [] args ) { System.out.println( "Gershwin, George" ); System.exit( 0 ); }
  • 0%
    int profitStartOfQuarter;int cashFlowEndOfYear;
  • 0%
    System.out.println( "Hello, world" );
  • 0%
    public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }
Q.3.
Suppose your name was Alan Turing. Write a statement that would print your last name , followed by a comma, followed by a space and your first name .
  • 0%
    System.out.println(num + " " + cost + "\n");
  • 0%
    System.out.println( "Hello, world" );
  • 0%
    System.out.println( "Turing, Alan" );
  • 0%
    System.out.println(count);
Q.4.
Suppose your name was George Gershwin. Write a complete main method that would print your last name , followed by a comma, followed by a space and your first name .
  • 0%
    int profitStartOfQuarter;int cashFlowEndOfYear;
  • 0%
    public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }
  • 0%
    System.out.println( "Turing, Alan" );
  • 0%
    public static void main( String [] args ) { System.out.println( "Gershwin, George" ); System.exit( 0 ); }
Q.5.
Write a statement that prints Hello, world to the screen.
  • 0%
    System.out.println(count);
  • 0%
    System.out.println( "Turing, Alan" );
  • 0%
    System.out.println( "Hello, world" );
  • 0%
    System.out.println(num + " " + cost + "\n");
Q.6.
Declare an integer variable named degreesCelsius.
  • 0%
    int degreesCelsius;
  • 0%
    int profitStartOfQuarter;int cashFlowEndOfYear;
  • 0%
    System.out.println(count);
  • 0%
    import javax.swing.JOptionPane;
Q.7.
Write a complete program whose class name is Hello and that displays Hello, world on the screen.
  • 0%
    public class Hello{ public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }}
  • 0%
    public class Q {public static void main(String[] a) {System.out.println("Q"); }}
  • 0%
    public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }
  • 0%
    public static void main( String [] args ) { System.out.println( "Gershwin, George" ); System.exit( 0 ); }
Q.8.
A compiler translates source code into_______
  • 0%
    public class Hello{ public static void main( String [] args ) { System.out.println( "Hello, world" ); System.exit( 0 ); }}
  • 0%
    executable code
  • 0%
    int degreesCelsius;
  • 0%
    public class Q {public static void main(String[] a) {System.out.println("Q"); }}
Q.9.
The standard name of the Java compiler is
  • 0%
    import javax.swing.JOptionPane;
  • 0%
    int degreesCelsius;
  • 0%
    syntax
  • 0%
    javac