User Tools

Site Tools


cs257e17:proj2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cs257e17:proj2 [2017/03/03 17:25]
scarl created
cs257e17:proj2 [2017/03/03 17:39] (current)
scarl
Line 8: Line 8:
    y = super.top();​    y = super.top();​
    ​super.pop();​    ​super.pop();​
-   z = (short) x + y;+   z = (short) ​(x + y)// cast because type of the result is int
 </​code> ​ </​code> ​
  
Line 15: Line 15:
 <code java> <code java>
 Object[] elementsCopy = elements; Object[] elementsCopy = elements;
-for (int i = 0; i < topIndex; i++) {+for (int i = 0; i <topIndex; i++) {
    ​System.out.println((Short) elementsCopy[i]);​    ​System.out.println((Short) elementsCopy[i]);​
 } }
 </​code>​ </​code>​
cs257e17/proj2.1488583504.txt.gz ยท Last modified: 2017/03/03 17:25 by scarl