What will this code segment output?
System.out.println("Hello");
System.out.println("World");
Hello
World
Which code segment will print “Hello Karel” to the screen in Java?
System.out.println("Hello Karel");
What will this code segment output?
public class Printing
{
public static void main(String[] args)
{
System.out.println("*****");
System.out.println("****");
System.out.println("***");
System.out.println("**");
System.out.println("*");
}
}
*****
****
***
**
*
What is the correct syntax for writing the main method in Java?
public static void main(String[] args)
{
}
What is the result of this expression?
150 % 100
50
Which of the below is NOT a Java arithmetic operator?
+
-
#
/
#
What will be the output of the following code snippet?
public class Calculator
{
public static void main(String[] args)
{
int first = 7;
int second = 2;
int result = first / second;
System.out.println(result);
}
}
3