1.1.2 & 1.3.2 : Printing in Java & Arithmetic Expressions

studied byStudied by 1 person
0.0(0)
Get a hint
Hint

What will this code segment output?

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

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

Explore top notes

note Note
studied byStudied by 56 people
... ago
4.5(2)
note Note
studied byStudied by 18 people
... ago
5.0(1)
note Note
studied byStudied by 26 people
... ago
5.0(1)
note Note
studied byStudied by 24 people
... ago
5.0(1)
note Note
studied byStudied by 7 people
... ago
5.0(1)
note Note
studied byStudied by 22 people
... ago
5.0(1)
note Note
studied byStudied by 5 people
... ago
5.0(1)
note Note
studied byStudied by 2066 people
... ago
4.6(5)

Explore top flashcards

flashcards Flashcard (38)
studied byStudied by 52 people
... ago
5.0(1)
flashcards Flashcard (38)
studied byStudied by 4 people
... ago
5.0(1)
flashcards Flashcard (65)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (799)
studied byStudied by 10 people
... ago
5.0(2)
flashcards Flashcard (78)
studied byStudied by 5 people
... ago
5.0(1)
flashcards Flashcard (35)
studied byStudied by 21 people
... ago
5.0(1)
flashcards Flashcard (53)
studied byStudied by 2 people
... ago
4.0(1)
flashcards Flashcard (43)
studied byStudied by 5 people
... ago
5.0(1)
robot