Question 2 Which of the following statements about the code above are true? Select all that apply. You can assume that the Node class is the same one used in the HW05 JAR file. In fact, you can compile and run this code to check your answers as long as you add the JAR file to the classpath. The line marked output 3 will print null when the code is executed. OThe line marked output 4 will print simon when the code is executed. O The line marked output. 1 will print null when the code is executed. O The line marked Output 2 will print Sally when the code is executed.

CMPTR
3rd Edition
ISBN:9781337681872
Author:PINARD
Publisher:PINARD
Chapter22: Integrating Word, Excel, Access, And Powerpoint
Section: Chapter Questions
Problem 4QY
icon
Related questions
Question
Question 1
Which of the following are regular files and directory files contained in the JAR file
that is provided with the HWO5 starter code? When listing the contents of the JAR
file, you can ignore any differences in capitalization of the filenames if you notice
any.
C cs1302/adt/StringList.class
C cs1302/adt/Node.class
META-INF/MANIFEST.ME
Ccs1302/adt/Stringlist.java
C cs1302/
C META-INF/
C cs1302/adt/
LinkedListDriver
package cs1302.listadt;
public class Driver {
public static void main (String[] args) {
Node node = new Node ("Tom");
node.setItem ("Susan") ;
node.setNext (new Node ("Sally"));
node.getNext (). setNext (new Node ("Barry"));
Node end = new Node ("Supa Mike", node);
Node n = node.getNext () ;
n.setNext (new Node ("Simon"));
System.out.println (end.getNext ());
// Output
1
System.out.println (node.getNext ().getitem ()); //
Output 2
System.out.println (n.getNext ().getNext ());
// output
3
System.out.println (n.getNext ().getItem ());
//
Output 4
} // main
} // Driver
Question 2
Which of the following statements about the code above are true? Select all that
apply. You can assume that the Node class is the same one used in the HW05 JAR
file. In fact, you can compile and run this code to check your answers as long as you
add the JAR file to the classpath.
| The line marked Output 3 will print null when the code is executed.
|The line marked Output 4 will print simon when the code is executed.
| The line marked output 1 will print null when the code is executed.
| The line marked Output 2 will print Sally when the code is executed.
Transcribed Image Text:Question 1 Which of the following are regular files and directory files contained in the JAR file that is provided with the HWO5 starter code? When listing the contents of the JAR file, you can ignore any differences in capitalization of the filenames if you notice any. C cs1302/adt/StringList.class C cs1302/adt/Node.class META-INF/MANIFEST.ME Ccs1302/adt/Stringlist.java C cs1302/ C META-INF/ C cs1302/adt/ LinkedListDriver package cs1302.listadt; public class Driver { public static void main (String[] args) { Node node = new Node ("Tom"); node.setItem ("Susan") ; node.setNext (new Node ("Sally")); node.getNext (). setNext (new Node ("Barry")); Node end = new Node ("Supa Mike", node); Node n = node.getNext () ; n.setNext (new Node ("Simon")); System.out.println (end.getNext ()); // Output 1 System.out.println (node.getNext ().getitem ()); // Output 2 System.out.println (n.getNext ().getNext ()); // output 3 System.out.println (n.getNext ().getItem ()); // Output 4 } // main } // Driver Question 2 Which of the following statements about the code above are true? Select all that apply. You can assume that the Node class is the same one used in the HW05 JAR file. In fact, you can compile and run this code to check your answers as long as you add the JAR file to the classpath. | The line marked Output 3 will print null when the code is executed. |The line marked Output 4 will print simon when the code is executed. | The line marked output 1 will print null when the code is executed. | The line marked Output 2 will print Sally when the code is executed.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage