Hello, first post here. I'm in my second semester of Java ever now, and I cannot seem to see what the professor wants in this program. He's tried to explain this to me, but maybe I need it from another person's point of view...He also mentioned that in CharNode each of those methods should be really simple, I've filled them in with what I can, not sure if those are right though!
Code:
class CharNode {
private char letter;
private CharNode next;
public CharNode(char ch, CharNode link) {
}
public void setCharacter(char ch) {
letter = ch;
}
public char getCharacter() {
return letter;
}
public void setNext(CharNode next) {
this.next = next;
}
public CharNode getNext() {
return next;
}
}
class CharList {
private CharNode head;
// member variable pointing to the head of the linked list
public CharList(CharList l) {
// copy constructor (is that the right terminology?)
}
public CharList(String s) {
// constructor from a String
toString();
}
public String toString() {
// for output purposes -- override Object version
}
public void addHead(char ch) {
// create a new node and add it to the head of the list
}
public void addTail(char ch) {
// create a new node and add it to the tail of the list
}
public void reverse() {
// modify the list so it is reversed
}
public void removeChar(char ch) {
// remove all occurrences of the character from the list
}
public int length() {
// how many nodes in the list
}
}
I know it's a lot of stuff to help with, but there is very little activity on our school's webct and the professor doesn't seem to be online right now...Thanks to anyone who tries to help.
BHM>To start, press any key.
Lagos>Where's the "any" key?_