How does XStream gets my object values since they are private?
import com.thoughtworks.xstream.XStream;
class Person {
private String name;
public Person(String n) {
name = n;
}
}
public class Main {
public static void main(String[] args) {
XStream stream = new XStream();
Person p = new Person("Joe");
String xml = stream.toXML(p);
System.out.println(xml);
}
}
and how do i highlight and indent my code in stackoverflow?