Menu
Topics Index
...
`

Session 6 Test has these questions


Hello World Program

What will be the output of the following program.
class HelloWorld
{
    public static void main(String t[])
    {
        System.out.println("Hello World");
    }
}
A. Program does not compile since the keyword class should start with capital C
B. Hello World
C. Program does not compile since the variable name of the arguments is t.
 The name should be either s or args
D. HelloWorld



Identify invalid keyword

Identify the invalid java keyword in the below list
A. integer
B. float
C. char
D. double



Print I Love java

Arrange the following program such that it compiles and prints I Love Java. Unselect any unwanted statements using the check box.
  • move { public static void main(String s[]) { System.out.println("I Love Java"); } }
  • move { Public static void Main(String args[]) { System.out.println("i love java"); } }
  • move class PrintJava
  • move { Public Static Void Main() { System.out.println("I Love Java"); } }



Simple Java Program

Arrange the following program such that it compiles and prints Hello World. Unselect any unwanted statements using the check box.
  • move }
  • move     public static void main(String args[])
        {
  • move class PrintHelloWorld
    {
  • move         System.out.println("Hello World");
        }
  • move     private static int main(String s[])
        {



Java Keywords1138

Which of the following is/are Java keyword(s)?

1. import
2. implement
3. run
4. default
A. 1 only
B. 1 and 3
C. 1 and 4
D. 2 and 3
E. 3 and 4



© meritcampus 2019

All Rights Reserved.

Open In App