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.
Type: Posts; User: red7
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.
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
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...
Hmm. Using eclipse, and on the line with the x it just says : "length cannot be resolved or is not a field"
"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...
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...
@ 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...
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)...
Is using a method from one class as a parameter for another class possible?
Example :
Class1 method:
public void initialA ()
{
if(a<b)
a++;