Results 1 to 6 of 6
  1. #1
    blueduiker is offline Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    55
    Rep Power
    0

    Default does anyone know what is wrong with this?

    does anyone know what is wrong with this sort?

    Java Code:
    //Sort the values of the 4 rolls
    	    			for (int index = 1; index < 4; index++)
    	    				// index refers to the element that is "trying to find its place"
    	    			{
    	    				int key = fourRollVals[index];
    	    				int position = index;
    	
    	    				// shift larger values to the right
    	    				while (position > 0 && fourRollVals[position-1] >= key)
    	    				{
    	    					fourRollVals[position] = fourRollVals[position-1];
    	    					position--;
    	    				}
    	
    	    				fourRollVals[position] = key;
    	    			}
    it outputs the array as: [I@a90653

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    How do you try to output the array?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    blueduiker is offline Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    55
    Rep Power
    0

    Default

    System.out.println("The Sorted Array of the Rolls is: " + fourRollVals);

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default

    Quote Originally Posted by PhHein View Post
    Thanks for the heads-up

    db

  6. #6
    blueduiker is offline Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    55
    Rep Power
    0

    Default

    anyone who reads this please ignore this post.

    I didn't know that cross posting is against the rules and I shall never do it again.

    Anyways, this problem has been resolved as PhHein has been nice enough to still help me.

Similar Threads

  1. Replies: 4
    Last Post: 06-11-2013, 01:37 AM
  2. what am i doing wrong here?
    By GPB in forum New To Java
    Replies: 3
    Last Post: 03-21-2010, 04:04 PM
  3. what is wrong?
    By pinguxxx in forum Advanced Java
    Replies: 3
    Last Post: 07-15-2009, 12:33 PM
  4. What did i do wrong
    By jpnym15 in forum New To Java
    Replies: 8
    Last Post: 11-17-2008, 10:07 AM
  5. Can someone tell me what I did wrong??
    By booter4429 in forum New To Java
    Replies: 7
    Last Post: 08-13-2008, 08:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •