For you to do:
ALL print statements in this exercise should be on one line, no newlines.
-
Print out the character in the 5th index of the String str
-
Print out the character in the 8th index of the String str
-
Print out the character in the 1st index of the String str
-
Print out the index in the i-th index of the String str (i is a variable already declared for you)
class Main {
public static void main(String[] args) {
String str ="boopity bop";
int i = 10;
System.out.print(str.charAt(5));
System.out.print(str.charAt(8));
System.out.print(str.charAt(1));
System.out.print(str.charAt(i));
}
}
반응형
'Java_beginner(Repl.it) > Auto-Graded-Course(AP CS A)' 카테고리의 다른 글
009 - String Methods - substring (0) | 2019.11.26 |
---|---|
008 - String Methods - indexOf (0) | 2019.11.26 |
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 |