Hello,
so basically i am getting started with java.. I am doing work on eclipse, i am making a library project as a sample..
The library project includes the class of person and books..
here is my sample class of person:
package Library; public class person { private String name; private int maxBooks; public person(){ name = "unknown name"; maxBooks = 0; } public String getName(){ return name; } public int getMaxBooks() { return maxBooks; } public void setMaxBooks(int maxBooks) { this.maxBooks = maxBooks; } public void setName(String name) { this.name = name; } }
I have done this, but now i need code by which a user will enter his maxBooks and Name, and also a code that will output name and maximum books of the person, it may be like this?
?system.out.println(getPerson.name)
I have only taken two classes of java yet, sorry for this noob question.
Thanks for reading.