So I have created a simple class in Java like this:
public class Book {
private String author;
private String title;
public Book (String author, String title) {
this.author = author;
this.title = title;
}
}
public void checkInfo
Is there a way to parse a string (property) in order to get Book properties like this, instead of doing bookA.title
?
Book bookA = new Book("George Orwell","Animal Farm")
String property = "title";
System.out.print(bookA.property);
Thanks in adance!