Java class implementation