Search:

Type: Posts; User: red7

Search: Search took 0.13 seconds.

  1. Re: Need an Idea: storing elements of two different arrays?

    Wow, couldn't believe how clear it was when writing it down, feel kinda stupid now haha. Finally got it to work, much much thanks, problem solved.
  2. Re: Need an Idea: storing elements of two different arrays?

    How would I use a for loop to accomplish this?
    temp = Array 1 length + Array 2 length
    I would have:
    for(int i = 0; i<=temp;i++)
    Stuck there
  3. Need an Idea: storing elements of two different arrays?

    Heres what I got so far.

    1. Size of both array.
    2. An object array that has the size of both combined

    How would I pass all the elements of both array into that new object?.

    ex:
    Array 1...
  4. Re: Java Class : How do I set up a toString method for arrays?

    Hmm. Using eclipse, and on the line with the x it just says : "length cannot be resolved or is not a field"
  5. Re: Java Class : How do I set up a toString method for arrays?

    "Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    length cannot be resolved or is not a field

    at TestClass.concat(TestClass.java:41)
    at...
  6. Re: Java Class : How do I set up a toString method for arrays?

    Wont let me compile :

    public TestClass[] concat(TestClass...b1)
    {
    TestClass[] temp = new TestClass[b1.length+b.length]
    for(int i = 0;i<=temp.length;i++)
    return...
  7. Re: Java Class : How do I set up a toString method for arrays?

    @ aussiemcgr, much thanks, understand the toString now.

    @Norm
    I just notice examples in my book about that.

    So now I have a little problem understanding the constructor. How would I set it...
  8. Java Class : How do I set up a toString method for arrays?

    I'm having a problem with the toString method, or my code could be wrong. Heres an example:
    public class TestClass
    {
    private TestClass[] a;
    private int[] b;

    public TestClass(int...b)...
  9. Dealing with two Classes : Using method from one Class as a parameter to another

    Is using a method from one class as a parameter for another class possible?

    Example :

    Class1 method:

    public void initialA ()
    {
    if(a<b)
    a++;
Results 1 to 9 of 9