Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the proper Test class, which should have all the necessary methods 25 points for the below code to run properly and show the given

image text in transcribed
image text in transcribed
image text in transcribed
Write the proper Test class, which should have all the necessary methods 25 points for the below code to run properly and show the given output. public static void main(String args[]) try i Test stringTest - new Test(2) string Test.insert("test 1"); stringTest.insert("test 2"); if (string Test.isFull()) stringTest.increaseCapacity(); stringTest.insert("test 3"); stringTest.insert("test 4"); System.out.println("The string element is :"+ stringTest.getElement()); Test Integer> integerTest - new Test (Integer>(2); if (integerTest.isEmpty()) integerTest.insert(13); Integer Test.insert(14); System.out.println("The integer element is :"+ integerTest.getElement()); System.out.println("The removed element ist" + integerTest.remove()); System.out.println("The integer element is :". Integer test.getElement(); } catch (Exception e) { e.printStackTrace(); } Your answer Output Adding: test 1 Adding: test 2 Adding: test 3 Adding: test 4 The string element is :test 4 Adding: 13 Adding: 14 The integer element is :14 Removed entry: 14 The removed element is: 14 The integer element is :13 Code Sample (if needed) public static void main(String args) try Test stringTest = new Test(2): stringTest.insert("test 1"); string Test.insert("test 2"); if (stringTest.IsFull) string Test.increaseCapacity: string Test.Insert("test 3"); string Test.insert("test 4"); System.out.println("The string element is :+string Test.getElement(); Test Integer> integer Test = new Test Integer>(2); if (Integer Test.isEmpty) Integer Test.insert(13): integer Test.insert(14); System.out.println("The integer element is : "+ Integer Test.getElement(0); System.out.println("The removed element is:" + integer Test.remove(); System.out.println("The integer element is : + integerTest.getElement(s); ) catch (Exception e) { e.printStackTrace()

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 Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

Name three general characteristics of distributions.

Answered: 1 week ago