/*
import java.util.*;
class Point {
private int x, y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}
public class ObjectPropertyEx {
public static void print(Object obj) {
System.out.println(obj.getClass().getName());
System.out.println(obj.hashCode());
System.out.println(obj.toString());
System.out.println(obj);
}
public static void main(String[] args) {
Point p = new Point(2,3);
print(p);
}
}
*/
/*
import java.util.*;
class Point {
int x, y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
public String toString() {
return "Point(" + x + "," + y + ")";
}
}
public class ToStringEx {
public static void main(String[] args) {
Point p = new Point(2,3);
System.out.println(p.toString());
System.out.println(p);
System.out.println(p + "입니다.");
}
}
*/
/*
import java.util.*;
class Point {
int x, y;
public Point(int x, int y) {
this.x = x; this.y = y;
}
public boolean equals(Object obj) {
Point p = (Point)obj;
if(x == p.x && y == p.y) return true;
else return false;
}
}
public class EqualsEx {
public static void main(String[] args) {
Point a = new Point(2,3);
Point b = new Point(2,3);
Point c = new Point(3,4);
if(a==b)
System.out.println("a==b");
if(a.equals(b))
System.out.println("a is equal to b");
if(a.equals(c))
System.out.println("a is equal to c");
}
}
*/
/*
import java.util.*;
class Rect {
int width;
int height;
public Rect(int width, int height) {
this.width = width;
this.height = height;
}
public boolean equals(Object obj) {
Rect p = (Rect)obj;
if(width*height == p.width*p.height) return true;
else return false;
}
}
public class RectEqualsEx {
public static void main(String[] args) {
Rect a = new Rect(2,3);
Rect b = new Rect(3,2);
Rect c = new Rect(3,4);
if(a.equals(b)) System.out.println("a is equal to b");
if(a.equals(c)) System.out.println("a is equal to c");
if(a.equals(c)) System.out.println("b is equal to c");
}
}
*/
/*
import java.util.*;
public class WrapperEx {
public static void main(String[] args) {
System.out.println(Character.toLowerCase('A'));
char c1='4', c2='F';
if(Character.isDigit(c1))
System.out.println(c1 + "는 숫자");
if(Character.isAlphabetic(c2))
System.out.println(c2 + "는 영문자");
System.out.println(Integer.parseInt("-123"));
System.out.println(Integer.toHexString(28));
System.out.println(Integer.toBinaryString(28));
System.out.println(Integer.bitCount(28));
Double d = Double.valueOf(3.14);
System.out.println(d.toString());
System.out.println(Double.parseDouble("3.14"));
boolean b = (4>3);
System.out.println(Boolean.toString(b));
System.out.println(Boolean.parseBoolean("false"));
}
}
*/
/*
import java.util.*;
public class AutoBoxintUnBoxingEx {
public static void main(String[] args) {
int n = 10;
Integer intObject = n;
System.out.println("intObject = " + intObject);
int m = intObject + 10;
System.out.println("m = " + m);
}
}
*/
import java.util.*;
public class StringEx {
public static void main(String[] args) {
String a = new String(" C#");
String b = new String(",C++ ");
System.out.println(a + "의 길이는 " + a.length());
System.out.println(a.contains("#"));
a = a.concat(b);
System.out.println(a);
a = a.trim();
System.out.println(a);
a = a.replace("C#","Java");
System.out.println(a);
String s[] = a.split(",");
for (int i=0; i<s.length; i++)
System.out.println("분리된 문자열" + i + ": " + s[i]);
a = a.substring(5);
System.out.println(a);
char c = a.charAt(2);
System.out.println(c);
}
}