How to pass data to another class?
This seems like a silly question but i've made 2 classes to test but i don't know how to pass data to another class.
Class 1 must be given a name and an age
Class 2 must "get" the data from class 1
I tried it with new class2(this.name, this.age);
and in class 2:
class2 class;
public class2(name, age) {
class.name();
}
I always get a nullpointerexception but i don't know how to pass the data in class 2 from class 1
any pointers?

