• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

I know that is simple but I don't get it why this code didn't run.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


 
Master Rancher
Posts: 4888
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happened when you tried to run the code?
Were there error messages?
Please copy the full text of the error message and paste it here. It has important info about the error.

Some major problems with the code is there is no class declaration or main method to start the class's execution.

Also be sure to wrap all posted code in code tags.
 
Marshal
Posts: 76447
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

You appear to have tried to use the code button: this inktells you how it works. Since you are new, I have corrected the code tags, and doesn't it look better now.
The code runs on JShell. As Norm said, what went wrong when you tried to run your code?
Why are you using the two for loops with break;? I think that for loops are inappropriate control structures for waht you require. I think, indeed, you shouldn't be using loops at all.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic