1. Engineering
  2. Computer Science
  3. i keep getting this error please help what am i...

Question: i keep getting this error please help what am i...

Question details

i keep getting this error:

please help, what am i doing wrong?

error: invalid method declaration; return type required
public StackOfIntegers(){   
^

error: invalid method declaration; return type required
public StackOfIntegers(int capacity) {
^

original:

public StackOfIntegers(){   
this (size);
}

public StackOfIntegers(int capacity) {
elements = new int[capacity];
}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution