Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Challenge for you

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    5
    My Mood
    Bored
    Thanks
    0
    Thanked 1 Time in 1 Post

    Lightbulb Challenge for you

    Hey there

    Can anyone help me with source code to be able to change the letter order of a word i.e. -> "hello" becomes "ehlol"
    Thats is just an example. By the way, I don't want to use Math.random

    Thanks
    Gavin


  2. #2
    Member angstrem's Avatar
    Join Date
    Mar 2013
    Location
    Ukraine
    Posts
    200
    My Mood
    Happy
    Thanks
    9
    Thanked 31 Times in 29 Posts

    Default Re: Challenge for you

    If you don't want to use Math.random, or java.util.Random, what ordering of output letters do you want to use?

  3. #3
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,511
    My Mood
    Grumpy
    Thanks
    0
    Thanked 165 Times in 156 Posts

    Default Re: Challenge for you

    String text = "hello";
    System.out.println(text);
    text = "ehlol";
    System.out.println(text);
    That satisfies your requirements. If it is not what you want then you need to be more specific.
    Improving the world one idiot at a time!

  4. #4
    Member
    Join Date
    May 2013
    Posts
    33
    Thanks
    0
    Thanked 9 Times in 9 Posts

    Default Re: Challenge for you

    String[random int]

  5. #5
    Junior Member
    Join Date
    Aug 2012
    Posts
    5
    My Mood
    Bored
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Challenge for you

    Never mind, I figured it out...

Similar Threads

  1. Java Challenge on A Gradient Color Canvas
    By mikedflip2006 in forum AWT / Java Swing
    Replies: 1
    Last Post: January 2nd, 2013, 07:43 AM
  2. Programming challenge
    By pierce21 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: June 26th, 2012, 07:29 AM
  3. Replies: 3
    Last Post: January 13th, 2012, 01:11 PM
  4. Challenge: I need an animation loop outside of the paint method.
    By Spidey1980 in forum Java Theory & Questions
    Replies: 28
    Last Post: August 20th, 2011, 09:20 AM
  5. CHALLENGE - find the shortest path
    By ice in forum Algorithms & Recursion
    Replies: 13
    Last Post: January 20th, 2011, 11:30 AM