Search:

Type: Posts; User: codepoet

Search: Search took 0.37 seconds.

  1. Replies
    2
    Views
    17

    Re: display decimal numbers only

    try the substring() method.
    First get the index of the decimal point, and pass it to the substring() method.
    It will return a string starting from the decimal point until the end of the number.
  2. Replies
    4
    Views
    33

    Re: for loop with random numbers

    *** Code removed
  3. Replies
    2
    Views
    17

    Re: Which is the best java tutorial ?

    If you're a beginner I'd suggest you try Head First Java, I learned Java better when I read it, than in school.
  4. Replies
    4
    Views
    33

    Re: for loop with random numbers

    You should change the content of your conditions to countXxx++

    ex. if your vehicle code for truck is 3 then add 1 to countTruck

    then at the end of the for loop, thats where you print the...
  5. Replies
    1
    Views
    15

    Re: Random generation of id

    you could append a character to a Math.floor((Math.random() * [any number]) + [10000]);

    explanation:
    the 10000 will make sure that the number is always 5 digits.

    ex:
    Math.floor((Math.random()...
  6. Re: Write a program to reverse each word in line(sentence)?

    well, split the string of words by space first, then you can loop through it and reverse the words in each loop.
    You can use the string methods like
    split() and
    reverse()
  7. Re: Java Exercises and Challenges Recommendations for someone with intermediate skills.

    Try Project Euler and Codingbat. :)
  8. Re: can any one explain the solution for this program

    You will know if an object is eligible for garbage collector if it becomes UNREACHABLE, and this happens when you don't have any reference variable pointing to it. With this knowledge, you will be...
  9. Re: How many instances of class A does the following code create

    you used the new keyword twice. So the answer is definitely two.
  10. Replies
    6
    Views
    77

    Re: what is "SUCCESS" in method

    HI! May I ask if your class is EXTENDING THE ACTION Interface? If so, SUCCESS, INPUT, etc. are CONSTANT values which represents a corresponding string value. I'm using this when doing a Struts2...
Results 1 to 10 of 10