Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

please i neeed a java program

[画像:(Revising Listing 21.1) Revise the GenericStack class in Listing 21.1 to imple- ment it using an array rather than an ArrayList. You should check the array size before adding a new element to the stack. If the array is full, create a new array that doubles the current array size and copy the elements from the current array to the new array. Problem 21.3 asks you to write a generic method that removes duplicate items from an ArrayList. Write your method in a new class called Utilities. Please include a main method for this class that tests your method. Think carefully about the way you test your program. Developing a good test plan is as important as developing the code itself. Obviously, you should show that your generic method works for different types of objects, i.e. ArrayLists or arrays of Integer, Strings, FacebookUsers, etc. You should also test any unusual cases you can think of: what if the ArrayList or array is empty? what if it contains only one item? what if your removeDuplicates method is passed an ArrayList in which every item is identical? etc.]
expand button
Transcribed Image Text:(Revising Listing 21.1) Revise the GenericStack class in Listing 21.1 to imple- ment it using an array rather than an ArrayList. You should check the array size before adding a new element to the stack. If the array is full, create a new array that doubles the current array size and copy the elements from the current array to the new array. Problem 21.3 asks you to write a generic method that removes duplicate items from an ArrayList. Write your method in a new class called Utilities. Please include a main method for this class that tests your method. Think carefully about the way you test your program. Developing a good test plan is as important as developing the code itself. Obviously, you should show that your generic method works for different types of objects, i.e. ArrayLists or arrays of Integer, Strings, FacebookUsers, etc. You should also test any unusual cases you can think of: what if the ArrayList or array is empty? what if it contains only one item? what if your removeDuplicates method is passed an ArrayList in which every item is identical? etc.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education