What's the Error in this code below? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

What's the Error in this code below?

Why it gets error? and Why method groups is not converted into object? https://code.sololearn.com/cx09qIMz54bT/?ref=app

23rd Dec 2019, 6:43 PM
Gouse Basha
Gouse Basha - avatar
4 Answers
+ 3
On line 26, you call method delete without the parentheses. It should be: unbox.delete() Hope that helps.
23rd Dec 2019, 7:15 PM
r1c5
r1c5 - avatar
+ 2
@sneeze thank you for your response just now i have corrected it, since there is no paranthesis earlier on method delete, Here after will create own class to create object
23rd Dec 2019, 8:48 PM
Gouse Basha
Gouse Basha - avatar
+ 1
I have seen your code r1c5 is right. I like to mention. It is bad practice to call a class program. This is error prone, since you basically create another instance of program, including the main method. Please create your own class, to create a any object.
23rd Dec 2019, 8:44 PM
sneeze
sneeze - avatar
0
True. The parenthesis were causing the bug. I just wanted to point out, the bad practice. Code that shows the expected output is not without bugs or potential bugs.
23rd Dec 2019, 8:52 PM
sneeze
sneeze - avatar