Mr.Macdonald
October 27th, 2010, 11:59 PM
First off, yes this is homework. But don't freak out, because I just want a compiler error fixed. I have been programming for 4 years, I avoided Java for the last 3 of those to find that college uses it!!
So ...
Code (LimCapList Provided by teacher)
public class Array12<E> implements LimCapList<E> {
Object[] array;
int head;
int tail;
public static final int DEFAULT_CAPACITY = 10;
public Array12<E>() {
array = new Object[DEFAULT_CAPACITY];
head = tail = -1;
}
public Array12<E>(int cap) {
array = new Object[cap];
head = tail = -1;
}
... Other Stuff ...
}
Commands
$ javac Array12.java
Array12.java:9: <identifier> expected
public Array12<E>() {
^
Array12.java:14: <identifier> expected
public Array12<E>(int cap) {
^
2 errors
Don't write a class for me, just fix the error. Java and I don't work well together!
Thank you
So ...
Code (LimCapList Provided by teacher)
public class Array12<E> implements LimCapList<E> {
Object[] array;
int head;
int tail;
public static final int DEFAULT_CAPACITY = 10;
public Array12<E>() {
array = new Object[DEFAULT_CAPACITY];
head = tail = -1;
}
public Array12<E>(int cap) {
array = new Object[cap];
head = tail = -1;
}
... Other Stuff ...
}
Commands
$ javac Array12.java
Array12.java:9: <identifier> expected
public Array12<E>() {
^
Array12.java:14: <identifier> expected
public Array12<E>(int cap) {
^
2 errors
Don't write a class for me, just fix the error. Java and I don't work well together!
Thank you