O'Reilly logo

haXe 2 by Benjamin Dasnois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Animal class

In order to store information about animals, we will create a class named Animal. This class will be very simple, but it will have to be shared by both the client and the server. Indeed, the server will serialize several instances of this class, which means that the client will need this class to be able to unserialize it.

So, let's see how this class looks:

package zooKeeper;
class Animal
{
public var name : String;
public var number : Int;
public function new()
{
name = "";
number = 0;
}
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required