Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 664079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:33:37+00:00 2026-05-13T23:33:37+00:00

public class Arrys { private int[] nums; //Step 3 public Arrys (int arrySize) {

  • 0
public class Arrys {
    private int[] nums;

    //Step 3
    public Arrys (int arrySize) {
        nums = new int[arrySize];
    }

    public int [] getNums (){
        return nums;
    }
}

Test class:

public class TestArrys
{
    public static void main(String args[])
    {
        //Step 4
        Arrys arry = new Arrys(10);
        System.out.println("\nStep4 ");
        for(int index = 0; index < arry.getNums().length; index++) {
            System.out.print(arry.getNums());
        }
    }
}

It’s incredibly simple, that is why I think I’m doing something fundamentally wrong. All I want is to display the value of the array.

This is what I get back. I am totally lost, there is nothing in my book that explains this nor does googling it help.

Step4 
[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440[I@1ac88440
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:33:38+00:00Added an answer on May 13, 2026 at 11:33 pm

    You’re trying to print the array itself out several times. This code:

    for(int index = 0; index < arry.getNums().length; index++) {
        System.out.print(arry.getNums());
    }
    

    should (potentially) be this:

    for(int index = 0; index < arry.getNums().length; index++) {
        // println instead of print to get one value per line
        // Note the [index] bit to get a single value
        System.out.println(arry.getNums()[index]);
    }
    

    Or rather more simply:

    for (int value : arry.getNums()) {
       System.out.println(value);
    }
    

    When you call toString() on an array, it returns something like [I@1ac88440 where the [ indicates that it’s an array, I indicates the array element type is int, and @xxxxxxxx is the address in memory. It’s diagnostic, but not really helpful in most cases.

    Use Arrays.toString to get a more useful representation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class Test { public static void main(String[] args) { DemoAbstractClass abstractClass = new
public class A { private A(int param1, String param2) {} public static A createFromCursor(Cursor
Here is my class: public static class __9_7_Person implements Comparator<__9_7_Person> { private int height;
public class Knowing { static final long tooth = 343L; static long doIT(long tooth)
import java.util.ArrayList; import java.util.Arrays; public class Cloud { private ArrayList<Point> points; private double left;
import java.util.Arrays; import java.util.ArrayList; import java.util.Scanner; import java.util.Collections; import java.util.List; public class TennisTournament {
public class tryAnimActivity extends Activity { /** * The thread to process splash screen
public class MyClass { public string MyProperty{ get; set; } Now, I would like
public class Test1<Type> { public Type getCompositeMessage(Type... strings) { Type val = (Type) ;
public class WeeklyInspection : Activity { WebView view = (WebView) FindViewById(Resource.Id.inspectionWV); view.Settings.JavaScriptEnabled = true;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.