• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Doubt with java question

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

I'm starting in Java and I'm in doubt on the question below:



a) Hello from do-while
   ----
   Hello from while

b) Hello from do-while
   ----

c) ----
   Hello from while

d) Compilation error: Exception in thread "main" java.lang.Error: Unresolved compilation problems

e) n.d.a


Can you help?
 
Marshal
Posts: 74381
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please always tell us where such questions come from. Apart from the compiler error caused by missing quote marks, what does nda mean? Please avoid unexplained abbreviations. And what do you think the output would be when you correct the quotes? Would the code compile then?
 
renan freth
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

Please always tell us where such questions come from. Apart from the compiler error caused by missing quote marks, what does nda mean? Please avoid unexplained abbreviations. And what do you think the output would be when you correct the quotes? Would the code compile then?





Sorry ... I corrected the quotes.
This is a college question.
The "nda" means nothing to declare or none of the questions is right.

Which of the alternatives is correct.

Can you help me?
 
Sheriff
Posts: 16675
278
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When in doubt, the best way to find out is to see for yourself. Since you have access to a computer, you can try it out. Have you installed Java? Can you run jshell from the command line? (JShell is an interactive shell that will allow you to run those commands directly)
 
Bartender
Posts: 732
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Which of the alternatives is correct?

Which one do you think is correct, and why? Why do you think the others are incorrect?
 
reply
    Bookmark Topic Watch Topic
  • New Topic