
Java-Basic question-1
Quiz by Dr. Renuka Devi S
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
public class ______
{
public static void main(String[] args)
{
System.out.println("Hello");
}
}
In Java, each code statement must end with a semicolon (;)
System.out.println("Hello World!")
A file containing a class called MyClass should be saved as:
Java is case-sensitive: 'MyClass' and 'myclass' has different meaning.
Insert the missing part of the code below to output "Hello World".
public class MyClass
{
public static void main(String[] args)
{
------- . ------- . ------("Hello World");
}
}
Pick the correct method to print Hello World in Java
System.out.-------------("Hello World");
Pick the correct text so the code prints Hello Java
System.out.println( ----------------- );
Pick the correct method so that World is printed on a new line.
System.out.print("Hello");
System.out.---------("World");
Text inside println() must be wrapped inside double quotes.
The difference between println() and print() is that:
What is the correct integer value to complete the code
int myNum = _________;
System.out.println(myNum);
What is the correct character to assign the letter A to grade?
char grade = ;
Write the correct keywords to complete the switch structure
int day = 2;
_______(day)
{
_______1: System.out.println("Monday");
__________ ; case 2: System.out.println("Tuesday");
break;
}
Fill in the blanks to start a for loop.
for(int i = 0; i < 5;______ )
{
System.out.println(i);
}