Question
Using the Concordance program again, carry out the following experiments. For each experiment carry out the specified task and answer the associated questions as needed.
(a) Tn the class Conca rda n ce change its supcrclass from Has hMa p to Has hta b l e. Then recompile and rerun Concordance. Has anything changed? Why or why not? Explain.
(b) In the call to add in the Document class, remove the first argument's cast to String, and in the declaration of add in the Con co rda nee class, change the type of word from String to Object. Then recompile and rerun Concordance. Has anything changed? Why or why not? Explain.
(c) In the call to add in the Document class, eliminate the conversion of the value of number to Integer (via the newlnteger(number)), and in the declaration of add change the type of the parameter line from Integer to i nt. Then recompile and rerun Concordance. Has anything changed? Why or why not? Explain.
(d) In the Report class, change f. next() to f. next. toStri ng( ), then recompile and rerun Concordance. Has anything changed? Why or why not? Explain.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started