What is the output of the following Java statements? a) System.out.println (head.info); b) System.out.println (head.link.link.info); System.out.println (A.info);

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 3SA
icon
Related questions
Question
1. Consider the linked list shown below. Assume that the nodes are in the usual info-link
form with info of type int. If necessary, declare additional variables. (Assume that head, A,
and B are reference variables of the LinkedListNode type).
head
wwwwww
■*|-• *|-|-·* |-• |||-||-|⁹9|
30
60
91
-40
A
70
88
B
95
99
Transcribed Image Text:1. Consider the linked list shown below. Assume that the nodes are in the usual info-link form with info of type int. If necessary, declare additional variables. (Assume that head, A, and B are reference variables of the LinkedListNode type). head wwwwww ■*|-• *|-|-·* |-• |||-||-|⁹9| 30 60 91 -40 A 70 88 B 95 99
What is the output of the following Java statements?
a) System.out.println (head.info);
b) System.out.println (head.link.link.info);
c) System.out.println (A.info);
Transcribed Image Text:What is the output of the following Java statements? a) System.out.println (head.info); b) System.out.println (head.link.link.info); c) System.out.println (A.info);
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning