in our next java examplewe'll show how objectsrather than variables of primitive typescan be stored the person class in javaa data record is usually represented by class object let' examine typical class used for storing personnel data here' the code for the person classclass person private string lastnameprivate string firstnameprivate int age//public person(string laststring firstint /constructor lastname lastfirstname firstage //public void displayperson(system out print(last namelastname)system out print("first namefirstname)system out println("ageage)//public string getlast(/get last name return lastname/end class person we show only three variables in this classfor person' last namefirst nameand age of courserecords for most applications would contain many additional fields constructor enables new person object to be created and its fields initialized the displayperson(method displays person object' dataand the getlast(method returns the person' last namethis is the key field used for searches the classdataarray java program the program that makes use of the person class is similar to the higharray java program (listing that stored items of type long only few changes are necessary to adapt that program to handle person objects here are the major changes