2019/11/26
Creating Variables and Printing Them
For you to do:
-
Create two String variables called firstName and lastName respectively.
-
Assign the String "Bob" to firstName and "Jones" to lastName.
-
Print firstName and lastName, one per line. Each should use a different print statement.
import java.util.*;
class Main {
public static void main(String[] args) {
String firstName ="Bob";
String lastName="Jones";
System.out.println(firstName);
System.out.println(lastName);
}
}
반응형
'Java_beginner(Repl.it) > Auto-Graded-Course(AP CS A)' 카테고리의 다른 글
006 - String Methods - Length (0) | 2019.11.26 |
---|---|
005 - Creating Variables and Printing 5 (0) | 2019.11.26 |
004 - Creating Variables and Printing 4 (0) | 2019.11.26 |
003 - Creating Variables and Printing 3 (0) | 2019.11.26 |
002 - Creating Variables and Printing 2 (0) | 2019.11.26 |