Question: In the following code fragment the else body has a local variable, tempNode, how do you design that clause not to use tempNOde? (point

 In the following code fragment the else body has a local variable,  

In the following code fragment the else body has a local variable, tempNode, how do you design that clause not to use tempNOde? (point 5) public void addFirst(E e) { if (size == 0) {tail = new Node (e, null); tail.setNext(tail) } else { Node tempNode = new Node (e, tail.getNext()); tail.setNext(TempNode); } size++; }

Step by Step Solution

3.31 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To design the else clause without using the local variable tempNode you can directly manip... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!