Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Array Lists JAVA (fill in the blanks code to create desired output) The first part of this recitation will be building a simple BrowserHistory class

Array Lists JAVA (fill in the blanks code to create desired output)

image text in transcribed

image text in transcribed

image text in transcribed

The first part of this recitation will be building a simple BrowserHistory class to handle the forward and back buttons (for use methods) of a simple web browser. Here is some starter code. Your job 13 to implement the code marked to be implemented class WebPaget String url; String content; WebPage (String url, string content) t this.ur1 = url ; this.content -content public void display) System.out.println("URL:url); System.out.println( "Content: " content + " "); /* Doubly Linked list Node/ class Historystate t This activity is licensed under CC BY-SA 4.0 license. 1/4 CSCI-UA 102, In-class Group Activity WebPage page; Historystate prev; Historystate next // Constructor to create a new state // next and prev is by default initialized as null Historystate (WebPage p) t page p; class BrowserHistory t Historystate current; WebPage errorPage BrowserHistory() f current-null; errorPage new WebPage(null, "404 not found"); / Implement needed methods here // 1. navigate /I 2. back 3. forward Here is the main class that will be used to test your code public class recitation3 t public static void main(Stringl] args) BrowserHistory history -new BrowserHistory: history.back().display); history.navigate("www.nyu.edu", "we love purple").display); history.navigate("www.google.com, search for stuff") display O history.navigate("www.yahoo.com", "did you get lost looking for google?").display() history.navigate("www.amazon.com* "buy stuff").display() history.forward().display ); history.back().display); history.back).display); history.navigate("www.facebook.com", "search for friends").display) history.forward().display ); history.back().display); history.back).display ); history.back).display); history.forward().display); This activity is licensed under CC BY.SA 40 license 2/4 CSCI-UA 102, In-class Group Activity history.forward).display); Your code must match this output: No valid current page! URL: null Content: 484 not found URL: www.nyu.edu Content: We love purple URL: www.google.com Content: search for stuff URL: www.yahoo.com Content: did you get lost looking for google? URL:Www.amazon.com content : html>buy stuff

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions

Question

=+19.2. (a) Show that L"((0, 1], , A) is not separable.

Answered: 1 week ago

Question

Label the number line with the following coordinate: -5

Answered: 1 week ago