Creating Variables and Printing 5
For you to do:
-
Create a String variable called "name" and set it to "Chen"
-
Create an integer variable called "age" and set it to 50
-
Create an integer variable called "iq" and set it to the value of age (do NOT use ' = 50')
-
Print the value of name
-
Print the value of age without skipping a new line
-
Print the value of iq
class Main {
public static void main(String[] args) {
String name="Chen";
int age=50;
int iq=age;
System.out.println(name);
System.out.print(age);
System.out.print(iq);
}
}
반응형
'Java_beginner(Repl.it) > Auto-Graded-Course(AP CS A)' 카테고리의 다른 글
007 - String Methods - charAt (0) | 2019.11.26 |
---|---|
006 - String Methods - Length (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 |