File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public String getIsbn() {
23
23
return isbn ;
24
24
}
25
25
26
- @ Override
27
26
public String toString () {
28
27
return "Book [Title: " + title + ", Author: " + author + ", ISBN: " + isbn + "]" ;
29
28
}
@@ -38,7 +37,7 @@ public static void main(String[] args) {
38
37
while (true ) {
39
38
String choice = JOptionPane .showInputDialog (menu );
40
39
switch (choice ) {
41
- case "1" : // Add Book
40
+ case "1" : //To Add Books
42
41
if (bookCount >= books .length ) {
43
42
JOptionPane .showMessageDialog (null , "Library is full! Cannot add more books." );
44
43
break ;
@@ -50,7 +49,7 @@ public static void main(String[] args) {
50
49
JOptionPane .showMessageDialog (null , "Book added successfully!" );
51
50
break ;
52
51
53
- case "2" : // Remove Book
52
+ case "2" : //To Remove Book
54
53
String isbnToRemove = JOptionPane .showInputDialog ("Enter ISBN of the Book to Remove:" );
55
54
boolean found = false ;
56
55
for (int i = 0 ; i < bookCount ; i ++) {
@@ -67,7 +66,7 @@ public static void main(String[] args) {
67
66
}
68
67
break ;
69
68
70
- case "3" : // View All Books
69
+ case "3" : // To View All Books
71
70
String allBooks = "Books in Library:\n " ;
72
71
boolean hasBooks = false ;
73
72
for (int i = 0 ; i < bookCount ; i ++) {
You can’t perform that action at this time.
0 commit comments