Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Feb 13, 2017

…students

* @author Sphoorthi Gaddam
*/
public class Book {
Set<String> books = new HashSet<String>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since book is the domain object it should have it property called as name which could be string.

Scanner scan = new Scanner(System.in);
Book book;
Student student;
book = new Book();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do it Book book = new Book()

public class Student {

Map<String, String> students = new HashMap<String, String>();
Book book = new Book();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be required here since each time a student object is created, it will call book constructor and would create redundant / duplicate books.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant