Question: Please show proof output for this java program HasNoNullsTest (30) Write a class HasNoNullsTest with a method hasNoNulls that accepts on ArrayList with a wildcard
Please show proof output for this java program
HasNoNullsTest (30)
Write a class HasNoNullsTest with a method hasNoNulls that accepts on ArrayList with a wildcard type the returns a value of true if the ArrayList contains no null elements. Write a main program that tests with two ArrayLists.
The first ArrayList is of type Integer. It will be populated with a Integer values from 0 through 6 Then test for a null value printing the result as shown below.
Then add a null value at the end of the ArrayList, and retest printing the result as shown below..
null value added to the ArrayList, the second without any null values.
The second ArrayList is of type String. It will be populated with a String values from xxx0 through xxx6. Then test for a null value printing the result as shown below.
Then add a null value at index 3 of the ArrayList, and retest printing the result as shown below.
Output:
It is true that intArrayL has no null value
It is false that intArrayL has no null value
It is true that stringArrayL has no null value
It is false that stringArrayL has no null value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
