Could somebody tell me how this program works....

Hi, I am new in Java...I just bought a book and start to learn the java from that book. Here is one of the project exercise and seems that it is difficult for me to understand the flow of the program.
class HelpClassDemo {
public static void main(String args [])
throws java.io.IOException () {
char choice;
Help hlpobj = new Help;
for(;;) {
do {
hlpobj.showmenu();
do {
choice = (char) System.in.read () ;
} while (choice == '\n' | choice == '\r');
} while ( !hlpobj.isvalid (choice) );
if(choice == 'q' ) break;
System.out.println("\n");
hlpobj.helpon(choice);
Thats what the program code. I don't understand especially after the " } while( !hlpobj.isvalid(choice)); " part. And i don't know what is !hlpobj means....
Please help.....

you have already posted in "new to Java " Forum
Message was edited by:
srinivass

Similar Messages

  • Can any body tell me why this program works?!! It shouldn't work!

    I wrote this program in a different long way, but it worked...I got the code i just posted below, it works well as well, but i dont know how this works. It seems more effeciant as well.....Q:
    Write a program to read lines of text containing names and print each on a separate line.
    Eliminate duplicate names.
    Input lines may contain any number of names.
    import java.util.Scanner;
    public class Tut1P3 {
         //Write a program to read lines of text containing names and print each on a separate line.
         //Eliminate duplicate names.
         //Input lines may contain any number of names.
         public static void main(String args[]) {
             Scanner sc = new Scanner(System.in);
             String a[] = new String[ 1000 ];     // string to hold up to 1000 names        
             int i,     // loop control variable
             n = 0;      // number of names in array so far
                        //how hasNext works in memory?
             while ( sc.hasNext() ) {     //reads the next name
                    String next = sc.next();
                    for(i = n-1; i >= 0; i--){
                         System.out.println(a);
              if ( a[i].equals(next) ) //we have nothing in the array! it checks nothing!
                   break;
              if ( i < 0 ){
                   //this part doesn't make sense. Any quick help please..
                   System.out.println( a[ n++ ] = next );

    The line in question can be split up into 3 different lines.
    a[n] = next;
    System.out.println(a[n]);
    n++;

  • Could somebody tell me how to merge or insert pages of Acrobat 9.0 files in VB6?

    I know that Acrobat do not support VB6.
    The PDDoc.InsertPages method worked with Acrobat 6.0 files but is not working with Acrobat 9.0
    I looked into the Scripting Quicktest Professional and unfortunately I could not find how to create script using PDDoc.
    I even could not open document using PDDoc.Open method (return value is false).
    Could anybody help me?
    Thank you,
    Ben 

    Thanks Roger-
    What about the bookmarks? I really have nothing I want to save and transfer over because all I have been through with the old MBP and now this new one with the data that was transferred from my old MBP. I would have thought that the genius guy would have thought about the problems since he was the one who tried to fix the old MBP and left to talk to the manager and came back to tell me they were going to get me a new MBP.
    Anyway, what about the ONE-to-One that I registered on this computer and I have a link to click that brings me to my page and other things like my keychain or all my passwords and usernames? It looks like I missed some with the new MBP because it does not have a name and some small stuff like that is missing because I did not do a set-up. The genius guy did the transfer of all my stuff from my old MBP.
    There were a lot of updates that the genius guy did get (but when I got the MBP, I have been unable to get the machine to tell me I have new updates). I had to find out was I really missing updates or was it something else. I tried to find the place that lists the updates that come across <Apple>Software Updates... I found several "latest updates, recent 3rd party updates, top Apple downloads, but I am not sure which category is the one that tells me the updates I should have had. I know that iTunes it missed, but the rest I am not sure which list has the updates I need.
    Make any sense? I did not get an iLife disk. Is iLife on the grey disks now?

  • Could somebody tell me how to keep my fonts when sharing/sending/exporting a Pages doc to PDF?, it changes it every time

    I need to share PDF versions of my documents, but after use different options the result is the same, the fonts are changed and the documents look different. Does anyone knows how to avoid this?, I recently switch from a Macbook Intel late 2008 and I used to work by Printing to PDF without any trouble, however, that option on my new Mac Air does not work anymore.

    I was ASSUMING that it is 2gb because it always synced just fine with my 2gb shuffle.
    That doesn't appear to be the case now.  You can view the size of your Music library by browsing to the Music section of your iTunes library and looking at the number provided towards the bottom bar of the iTunes window. '
    And if I went to add more music folders to my library, when it would try to sync, it would tell me that my shuffle was at capacity.  So I was removing albums from my library so that it would sync.
    Again, as I stated above, you don't need to do this.  You could have just configured your iPod to sync a subset of your iTunes music library.
    Did you see the article I referenced above?
    B-rock

  • Please could somebody tell me how I can get an iMovie from my ipad2 on to a disc...?

    I really am struggling with this one and would be most grateful if somebody could help!
    I have created an iMovie on my ipad2 and I am trying desperately to get it onto a dics. The iMovie was created in HD and is taking up son,uh space on my ipad2 I can't really use it for anything else!
    I have managed to send the iMovie project to iTunes and I have downloaded it using my windows PC. Windows obviously doesn't recognise it as it is an iMovie file some can't seem to do anything with it??
    Really would appreciate any help out there! :)

    A quick search of these forums would answer your question, this has been answered lots of times.
    There is an online help for iMovie too that answers your question.
    You need to save to camera roll, then import the video to your computer as you would import a photo.
    Then use what ever software you use to burn to a disk.

  • Please help this dummy...How this program works??

    Hi, I am new in Java...I just bought a book and start to learn the java from that book. Here is one of the project exercise and seems that it is difficult for me to understand the flow of the program.
    class HelpClassDemo {
    public static void main(String args [])
    throws java.io.IOException () {
    char choice;
    Help hlpobj = new Help;
    for(;;) {
    do {
    hlpobj.showmenu();
    do {
    choice = (char) System.in.read () ;
    } while (choice == '\n' | choice == '\r');
    } while ( !hlpobj.isvalid (choice) );
    if(choice == 'q' ) break;
    System.out.println("\n");
    hlpobj.helpon(choice);
    Thats what the program code. I don't understand especially after the " } while( !hlpobj.isvalid(choice)); " part. And i don't know what is !hlpobj means....
    Please help.....

    is it indicated the opposite of hlpobj object or the
    opposite of isvalid method?the opposite of the result of isvalid method.
    if isvalid method returns true then the opposite of true which false because of the not sign(!)
    */

  • Could somebody tell me, how many pipelining request firefox 8.0.1 support? And also other pipelining settings related with boosting firefox.

    i use a HSD data card to connect to internet and after end of fair usage data of 5GB my speed is cut down to 144kbps max. And this speed irritates me.
    And i am also interested in every activity of boosting the internet connection by any means.
    So, help me and Thanks.
    contact me at- [email protected]

    i use a HSD data card to connect to internet and after end of fair usage data of 5GB my speed is cut down to 144kbps max. And this speed irritates me.
    And i am also interested in every activity of boosting the internet connection by any means.
    So, help me and Thanks.
    contact me at- [email protected]

  • Can somebody tell me how could I unlock my disabled Iphone 5S?

    Can somebody tell me how could I unlock my disabled Iphone 5S?

    Restore the iPhone
    This is covered in the manual and asked and answered on these forums many times each day.
    Also a simple google search will find the apple article explaining how to do this.

  • Could somebody teach me how to set the lastest iTunes so that it repeats just one of the numbers installed from the CD? I've alreadly tried it by clicking "control" and the bottom, but it doesn't work. Thank you.

    Could somebody teach me how to set the latest iTunes so that it repeats just one of the numbers installed from the CD?
    I've already given it a try by clicking "control" and the bottom item which means one item in Japanese, but it doesn't work.
    Thank you.

    You can access the repeat options if you right-click on the shuffle icon or if menus are enabled you can use
    Controls > Repeat > Off | All | One.
    Once the control is visible you can click it to switch between states as before. If the control is turned to off it disappears on the next track change. In contrast the shuffle control remains visible whenever it is appropriate. Hopefully the next release will fix this.
    The bottom one should do it.
    tt2

  • Could anyone tell me how many discs are suppose to come in this 10.4 Tiger Box?

    Could anyone tell me how many discs are suppose to come in this 10.4 Tiger Box? I might have bought more than one box at one time and then just combined the discs. I have two black OS X discs that look almost identical with the exception of what looks one disk is 10.4 and the other is 10.4.6.

    One DVD or four CDs depending on what you purchased.
    (67080)

  • I've uploaded a photo from a file in my Mac OS X Snow Leopard onto Facebook and it needs to be enlarged.  Please could someone tell me how to do this?  Thank you.

    I've uploaded a photo from a file in my Mac OS X Snow Leopard onto Facebook but I want to enlarge this photo .  Please could someone tell me how to do this?  Thank you.

    For photos at least, maybe Video also though, GraphicConverter has a powerful tools for many things, like resize...
    http://www.lemkesoft.com/
    Just be sure to save the changed one with a different name to peserve your big original pic

  • I want application name can display more than 13 character.  Could you tell me how to fix this problem?

    I want application name can display more than 13 character.
    Could you tell me how to fix this problem?

    Backup and restore your software via iTunes. If the problem continues, restore as a NEW device. If this solves it, that means there is some corruption in your backup file. If the problem is still there, you should take it to the Genius Bar at an Apple Store for evaluation.

  • HT1338 Just got an Apple and totally new to this system please could someone tell me how and where I can connect my HP Photosmart 3310 for wifi? Thanks, Mike

    Just got an Apple and totally new to this system please could someone tell me how and where I can connect my HP Photosmart 3310 for wifi? Thanks, Mike

    Welcome to Apple Communities
    Start the printer, go to System Preferences > Print and Scan, press the + button and select the printer. Your printer and Mac must be connected to the same Wi-Fi

  • I have a project that crashed on me when I was about to finish it. When I try to reopen Final Cut Pro it wouldn't open until I took the project out of the Final Cut Project folder. Can somebody tell me if this is a problem that has a solution? I cannot

    I have a project that crashed on me when I was about to finish it. When I try to reopen Final Cut Pro it wouldn't open until I took the project out of the Final Cut Project folder. Can somebody tell me if this is a problem that has a solution? I cannot go back to the project at all.

    If you are using 10.0.3 or above Apple added a backups folder that for a little extra protection in cases like this. If you quite FCPX go to your Final Cut Pro Projects folder. Find the folder that has the project in question. If it has a backups folder there should be a file with a date stamp and .fcpproject extention, that is your back-up. Just move the back-up from that folder one folder up to the place where you deleted CurrentVersion.fcpproject from.  When I have had to do this I haven't renamed the backup but some people to recomend that you rename it to CurrentVersion.fcpproject and it seems to work both ways. Ofcourse it wont work if there is already a CurrenVersion file there you will need to delete that one first.
    If you don't have the backups folder or there is nothing in it I am not sure if there is anything that can be done.

  • Hi, I download the latest version of itunes and i have problem now to sync my iphone with my computer, I have windows 7 home premium service pack 1, can somebody tell me how to fix it. thanks

    Hi, I download the latest version of itunes and i have problem now to sync my iphone with my computer, I have windows 7 home premium service pack 1, can somebody tell me how to fix it. thanks

    This forum is for questions from those managing sites on iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. You'll be most likely to get help with this issue if you ask in the general iTunes forums.
    Regards.

Maybe you are looking for

  • 2 Problems with 2 different iPod Touch models.

    Hi, recently I've experienced a few problems with my First Generation iPod Touch, and my Second Generation iPod Touch also. The first gen. was updated to the most recent software, whereas the second gen. hadn't been updated with iOS 4 yet. Neither ha

  • OCI demos-not able to compile on red hat Linux

    Can anyone narrate how can I get the OCI routines (demo) working. I feel that they are failing to run. what are the check points needed that I should verify that an OCI program executes. Does this needs any special settings or running any script file

  • Copy and paste text in closed captioning

    Hi, need to copy text in to CC, but it seems not working. I have latest AC6 version on Mac.

  • Microsoft product not working some error showing

    Problem Event Name: BEX   Application Name: WINWORD.EXE   Application Version: 15.0.4569.1504   Application Timestamp: 52c5eccd   Fault Module Name: unknown   Fault Module Version: 0.0.0.0   Fault Module Timestamp: 00000000   Exception Offset: 002080

  • Moving Member in Entity Hierarchy

    Hi Guys, I have just been given the task of moving a member in our entity hierarchy. I know how to move the member, but do I have to re-consolidate the data after the move, and how far back do I re-consolidate? Thanks