1.1.2 & 1.3.2 : Printing in Java & Arithmetic Expressions

studied byStudied by 0 people
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 17 people
... ago
5.0(1)
note Note
studied byStudied by 208 people
... ago
5.0(2)
note Note
studied byStudied by 13 people
... ago
5.0(1)
note Note
studied byStudied by 8 people
... ago
5.0(1)
note Note
studied byStudied by 6 people
... ago
5.0(1)
note Note
studied byStudied by 8 people
... ago
5.0(1)
note Note
studied byStudied by 36 people
... ago
5.0(1)
note Note
studied byStudied by 1806 people
... ago
4.7(6)

Explore top flashcards

flashcards Flashcard (105)
studied byStudied by 8 people
... ago
5.0(1)
flashcards Flashcard (119)
studied byStudied by 8 people
... ago
5.0(1)
flashcards Flashcard (21)
studied byStudied by 12 people
... ago
5.0(1)
flashcards Flashcard (121)
studied byStudied by 13 people
... ago
5.0(1)
flashcards Flashcard (23)
studied byStudied by 7 people
... ago
5.0(1)
flashcards Flashcard (77)
studied byStudied by 156 people
... ago
4.8(5)
flashcards Flashcard (48)
studied byStudied by 2 people
... ago
5.0(1)
flashcards Flashcard (159)
studied byStudied by 1982 people
... ago
4.5(13)
robot