Results 1 to 2 of 2

Thread: Array Issue

  1. #1
    vknehra10 is offline Senior Member
    Join Date
    Dec 2016
    Posts
    103
    Rep Power
    0

    Default Array Issue

    Java Code:
    class Sort{
    
    int arr[];
    public void sort(int ar[]){
     arr=ar;
     System.out.println("owkayee"+" "+arr);
     }
     
     }
     public class Main{
     public static void main(String Dev[]){
     int a[]={10,11,12};
     Sort s=new Sort();
     s.sort(a);
     }
     }
    Output is : owkayee [I@1db9742

    how to print array values where i am doing mistke...

    Thanks

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Array Issue

    There is an Arrays utility class that has toString methods for converting an Array to a String represntation.

    At the moment it is defaulting to using the toString on the Object class.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Stuck on 2D array issue
    By scottdaking in forum New To Java
    Replies: 2
    Last Post: 02-25-2013, 07:11 PM
  2. Another Array Issue (SOLVED)
    By Captain Forge in forum New To Java
    Replies: 1
    Last Post: 11-22-2012, 07:45 AM
  3. Array issue
    By daemonlies in forum New To Java
    Replies: 1
    Last Post: 04-30-2012, 12:23 AM
  4. Array game issue
    By Arom in forum New To Java
    Replies: 2
    Last Post: 11-30-2011, 08:33 PM
  5. Sorting Array Issue
    By larson1118 in forum New To Java
    Replies: 2
    Last Post: 04-21-2011, 05:31 PM

Tags for this Thread

Posting Permissions

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