Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArrayList<String> seen_author = new ArrayList();
- int count=0;
- for (int i = 0; i < numberOfBooks; i++){
- if(!seen_author.contains((book[i].getAuthor())){
- for (int j = i+1; j < numberOfBooks; j++){
- if (book[i].getWriter().equals(book[j].getWriter())) {
- count++;
- }
- }
- seen_author.add((book[i].getAuthor())
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement