• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java applications, control structures and some general questions

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi and a beautiful day to someone on this forum. I'm throwing some questions to the open and i'll really appreciate somebody's patience. My question isn't one but a number of them. I just believe we have one thing to learn (however simple) from time to time...

(i) I've created an application program in java. How can i or somebody else run it just by the click of a button i.e without necessarily utilizing the command line utility? I'll appreciate clear answers...

(ii) How can i package my java program in such a way that users can install it on their computers via a cd or storage medium just like most of us install other developed software? Of course, as a pointer to the first question, I'll want it to be run by the click of a button.

(iii) In what particular instance of program design should a do-while construct be appropriate at the expense of the while construct. I'll appreciate if practical instances are given to this question. Is there really a significant difference to using any of these constructs other than just the time in which a construct is accessed in a running program?

(iv)Do i really need the application of stream class and the system class to create an application that can be executed via the command line in which i can input numbers one at a time by pressing 'enter' and incrementing the additions and carry out basic calculations like summation or averaging? In a nutshell, how can i carry out this basic calculations from the command line with a number at a time?

(v) What is the significance of the root directory from the context of the command prompt?


(vi) When the phrase ‘java-enabled browser’ is said in java courses, can the phrase be taken
literally i.e does it mean the browser is actually empowered by java or the other way round. In
other words does it mean that the java interpreter is just a component of the browser software
that is activated once the browser is up and running. This question may appear simplistic but I
just want to be clear.


Olakunle Oni
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(i) You could create an executable jar file that contains the program. Users who have the JRE installed should then be able to double-click it to start the program.

(ii) There are a number of installer generators for Java. I've used IzPack in the past.

(iii) Sometimes you can make the code cleaner and easier to read by using a do-while instead of a while loop. The difference is ofcourse that in a do-while loop, the conditional expression is checked at the end instead of at the beginning of the loop. It's hard to give a conrete example, but sometimes you'll notice that a do-while is more appropriate.

(iv), (v) I don't understand what you mean here. Better explain it in more detail in a separate topic.

(vi) They probably mean a web browser that is capable of running Java applets.

We prefer that you ask one thread per question, especially if the questions don't really have anything to do with each other - otherwise you'll get a big mega-topic where several discussions are running at the same time.
reply
    Bookmark Topic Watch Topic
  • New Topic