I am modelling classes in Java to store a JSON , for a particular JSON
"id":1,
"firstName":"sample",
"lastName":"person",
"Books":{
"bookName":"gone with the wind"
"isbn": 12345
}
I created a class person
with int id , String firstName
etc...
what would be the best way to store bookName , make a class Books
with a String bookName
and int isbn
, how would I represent books in the person class , As an array? since books always has only one value is there a better way to represent it