1.1.2 & 1.3.2 : Printing in Java & Arithmetic Expressions

studied byStudied by 1 person
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 6

7 Terms

1

What will this code segment output?

System.out.println("Hello");
System.out.println("World");

Hello
World

New cards
2

Which code segment will print “Hello Karel” to the screen in Java?

System.out.println("Hello Karel");

New cards
3

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("*");
}
}

*****
****
***
**
*

New cards
4

What is the correct syntax for writing the main method in Java?

public static void main(String[] args)
{

}

New cards
5

What is the result of this expression?

150 % 100

50

New cards
6

Which of the below is NOT a Java arithmetic operator?

+

-

#

/

#

New cards
7

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

New cards
robot