19 lines
385 B
Java
19 lines
385 B
Java
//: references/Stringer.java
|
|
|
|
public class Stringer {
|
|
public static String upcase(String s) {
|
|
return s.toUpperCase();
|
|
}
|
|
public static void main(String[] args) {
|
|
String q = new String("howdy");
|
|
System.out.println(q); // howdy
|
|
String qq = upcase(q);
|
|
System.out.println(qq); // HOWDY
|
|
System.out.println(q); // howdy
|
|
}
|
|
} /* Output:
|
|
howdy
|
|
HOWDY
|
|
howdy
|
|
*///:~
|