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?

[502 byte] By [deAppela] at [2007-11-27 6:56:26]
# 1
silly me,I forgot to change the constructer.public GameEngineData(PlayerData player){}its working now.
deAppela at 2007-7-12 18:33:23 > top of Java-index,Java Essentials,Java Programming...
# 2
> its working now.Congrats! Give yourself a Duke's star!
petes1234a at 2007-7-12 18:33:23 > top of Java-index,Java Essentials,Java Programming...