Search:

Type: Posts; User: dulitul

Search: Search took 0.30 seconds.

  1. loop through linked list of objects and their fields

    Below I have got a class with two int variables from which I have created a number of objects which I have stored in the linked list. Now I want to loop through each object and compare THEIR FIELDS...
  2. Replies
    11
    Views
    239

    Re: please help me with the Code below

    Yes I know that. Already tried it before. However, the issue comes from the fact that it is posted more than once. I want a single statement if there are no matches. For example in my code it would...
  3. Replies
    11
    Views
    239

    Re: please help me with the Code below

    Ok guys,

    I fixed it and found my error. Please see below. I used boolean true/false for the purpose. However, now I am struggling with another requirement. I want a message to be printed if there...
  4. Replies
    11
    Views
    239

    Re: please help me with the Code below

    I am looking for someone to tell me the solution as I cannot fix it.
  5. Replies
    11
    Views
    239

    Re: please help me with the Code below

    Will do. Thanks. However, this does not solve my problem as main code does not work.
  6. Replies
    11
    Views
    239

    Re: please help me with the Code below

    If I type in:

    lower bound = 1
    upper bound = 5

    Output - "You typed in number less than two. Please try again." ---- This works fine

    2)
    lower bound = 6
    upper bound = 3
  7. Replies
    11
    Views
    239

    please help me with the Code below

    Hello guys,

    I have got a task to print all prime numbers in a certain range. Could you please tell me why the code does not work? The data validation works correct but the main task to print the...
  8. Replies
    5
    Views
    210

    Re: simple java calculation

    ohhh..right..now I got it. How stupid..it will be 0. It will be 10: 100 and not 100:10.

    How about expressions like

    m = j++ + k. Can you tell me what will be the precedence order and the result...
  9. Replies
    5
    Views
    210

    Re: simple java calculation

    int / int = int

    100:10 = 10 and not 0. This is the way I get it. Could you please clarify what do you exactly mean?
  10. Replies
    5
    Views
    210

    simple java calculation

    Hello guys,

    I am currently learning Java. Excuse me for my stupid question. I have come across an example in my book which I don't quite understand. Can anyone explain me please?

    K has the...
  11. Replies
    2
    Views
    205

    string comparison java

    Hello,

    Could anyone tell me why the code below is not working?



    if (!gender.equals("man") || !gender.equals("female"))
    System.out.println("unrecognized gender!." + " Please try again");...
  12. Replies
    7
    Views
    337

    Re: Java programme design help

    Thank you Greg. The code is more or less the same except the changes you've made. I was just wondering why swaping the places of the classes within the same file rectified the issue. Is it because...
  13. Replies
    7
    Views
    337

    Re: Java programme design help

    Hello Greg,

    Thanks for your reply but it's still does not work. I have created a new source file and typed in



    }
    class CubeUser
    {
    public static void main(String argv[])
  14. Replies
    7
    Views
    337

    Re: Java programme design help

    Hello Greg,

    Thank you for your reply. This is how the code should look like, I guess. I am getting the following error in the console - 'cube.java19: Illegal static declaration in inner class...
  15. Replies
    7
    Views
    337

    Java programme design help

    Hello guys,

    I am a complete novice in Java. Just started my course in Computer Science and I was given an assignment to write a code for a programme. The test of the exercise is the following:
    ...
Results 1 to 15 of 15