0
Can you guys suggest me what to do
12 ответов
+ 1
Mention you doubt clearly...
In Main method declaration you missing String array[] as method argument..
See this...
https://www.sololearn.com/learn/Java/2137/
And use break statements after every case.. Other wise next cases also get executed...
+ 1
Prashant Shukla
BlueJ is a development environment which is a deliberately smaller and simpler interface than professional environments like NetBeans or Eclipse. This allows beginners to get started more quickly and hence doesnt force you to write the main() instead it does it for you in the background
https://www.cs.utexas.edu/users/scottm/cs307/handouts/BlueJProjectInstructions.html
Where as Netbeans and Eclipse mandate that you type code manually rather than use a drag and drop approach which is there in BlueJ.
Having said that public static void main(String[] arg){...} is the starting point for a standard standalone program.
0
Sorry but string args is not necessary as it is needed when we create object
0
But you need in for main method.
The main method is the starting point of execution. After starting main method you can create object. Otherwise you can't, because your Program goes for compilation but not for execution...
0
Bro I have done a lot of coding in bluej and I was in habit of not writing string args and never got error I want to know why I am getting error here
Secondly I want to know if I can write infinite loop here
0
There it implicitly adds main method in the background by application. So it calls that method... Here you can't..
Infinite loop means? As in your program, it accepts inputs until you input a==0 fails... It is Infinite only..
Are you getting desired output for your program?
0
No is not getting desired results
This program is meant to enable us to rerun program directly from input window without having to run it again from main window
0
Here, You can enter all the required inputs only ones..
It does not call input console again..
So you need inputs like this..
Ex:
3 2 2 2
0
Okk thanks
0
I understood that it is not It is not like other ide's and we can not run a infinite loop which can get input again in real runtime
Thanks
0
You can but in a way that,
give all n' inputs at ones only by space separated which you give in other IDEs n' inputs one after one like a real time.
Wel come.
0
Thanks for help