Looks like what you get in the file is a result of method toString() invocation on an object of this class: myproject.Library.BookInformation.
So the quickest fix in your case would be to override toString() method for BookInformation to return what you need.
public String toString() {
return getBookName(); // Or whatever you see fit.
}
Even if later you'll change your code not to rely on toString() a meaningful implementation is not going to hurt.
Unlike in another answer you do NOT have to change code for AddToFile if you override toString(). However, if you don't modify code for BookingInformation, then you would have to craft string value when you call AddToFile similar to what was suggested:
AddToFile(bookinfo.getBookName()) // Or whatever you see fit.
Another even better way would be to modify AddToFile method to accept BookingInformation as a parameter.
public boolean AddToFile(BookingInformation bookinfos){
try{
PrintWriter Bpw=new PrintWriter(new FileOutputStream("AllBookRecords.txt",true));
Bpw.println(bookinfos.getBookName()); // Or whatever you see fit.
return true;
}
catch(IOException ioe){
return false;
}
}