Question:
How does one go about writing this program?
smooth
2006-01-31 03:53:35 UTC
Write a class file that takes an ArrayList object in its Constructor and stores it in a class variable. The class should contain a private method called "validate", which validates that each element in the ArrayList is a String object and that there are no null values. The class should also contain public methods that perform the following logic (each method should call the "validate" method before any logic is executed):

(1) Display each element of the array on a separate line (and this method should be called "toString()".
(2) Display a count of elements in the array.
(3) Convert each String contained in the array to lowercase and display.
(4) Convert each String contained in the array to uppercase and display.
(5) Write a method called "runAll()" that calls (executes) each of the methods above.

Write a second class that calls the runAll() method of the first class within its main() method. Second class is to be used for testing the functionality of the first class.
Five answers:
♥tendersighs♥
2006-01-31 04:36:31 UTC
And what class do you need this for? When is it due? The point of takeing the class is so that YOU learn how to do it. Don't be one of those jerks that pass the class but can't figure out how to reboot their own PC. Use your brain!!
?
2016-11-11 11:39:20 UTC
of course we are in a position to. My son is appearing some variety of artwork on the Linux kernal as a interest. i'm greater constrained. i will in straight forward terms write common (no longer that that does plenty sturdy anymore) and HTML. How do you think of we've been given our classes back interior the days whilst the TRS eighty kind One and the Apple have been the only abode computers available and there replaced into little or no commercial application?
varunM
2006-01-31 04:09:49 UTC
this is not fair..I can write the whole class, but I wont . you can ask a specific question, if you are feeling any problem
bigbubba
2006-01-31 04:02:28 UTC
Do you own homework!
inin
2006-02-02 02:29:21 UTC
Do it yourself and learn.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...