강의 1
소스코드
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public class StringApp { public static void main(String[] args) { // Character VS String System.out.println( "Hello World" ); // String System.out.println( 'H' ); // Character System.out.println( "H" ); System.out.println( "Hello " + "World" ); // new line System.out.println( "Hello \nWorld" ); // escape System.out.println( "Hello \"World\"" ); // Hello "World" } } |
강의 1
소스코드
1 2 3 4 5 6 7 8 9 10 | public class StringOperation { public static void main(String[] args) { System.out.println( "Hello World" .length()); // 11 System.out.println( "Hello, [[[name]]] ... bye. " .replace( "[[[name]]]" , "duru" )); } } |