CodeHS & Runestone: Chapter 1

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/3

flashcard set

Earn XP

Description and Tags

Computer Programming; Period 1

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

4 Terms

1
New cards

What will this code segment output?

System.out.println(“Hello”);
System.out.println(“World”);

a. Hello
World

b. HelloWorld

c. Hello World

d. Hello

World

a. Hello

World

2
New cards

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

a. System.out.printLine(“Hello Karel”);

b. print “Hello Karel”;

c. System.out.print(“Hello Karel”);

d. System.println(“Hello Karel”);

c. System.out.print(“Hello Karel”);

3
New cards

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

}

}

a. This won’t print anything.

b. *

**

***

****

*****

c. It will only print the first line as ***** since only one print statement can be used

4
New cards

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