Monday, July 18, 2011

CHALLENGE: Intermediate Java Tut's 4&5

The following is a challenge for new developers that have completed:
Intermediate Java Tutorial - 4&5 -Collections & arrayLists by theNewBoston

Legendary Challenge: 
Difficulty: ★ 1/2

Create two arrayLists, the first array must have 5 unique strings and the second array must consist of only the last 2 strings from the first array.Then create a method that will iterate through the first arrayList and filter out any strings that are also in the second array. Print your results.

Legendary Challenges consist of only a very broad description of the challenge making them a little harder.The end results should still be the same as the regular challenge.

1. Create a String array named "things" containing the strings "eggs", "lasers","hats" and "pie"
2. Create a new ArrayList named "list1"
3. Create a For loop that adds the items from the array "things" to "list1"
4. Create a String array named "things2" containing only the strings "lasers" & "hats" 
5. Create a new ArrayList named "list2"
6. Create a For loop that adds the items from the array "things2" to "list2"
7.Print all the strings in list1 one using a for loop

End of Tut 4/Start of Tut 5

8.Create a method a called editList that uses two collection parameters and names them "A1" and "A2"
(to make it less confusing just remember that in a later step we will call the editList method and use "list1" & "list2" as parameters) 

9. Inside the editList method loop through each string in "A1" and make sure none of the strings are the same as any of the strings in "A2" 

10.If any of the strings from "A1" do match any of the strings from "A2" delete the string from "A1"

11.Call the editList method using "list1" & "list2" as parameters

12.Print a blank line

13.Print each of the strings in list1 using a for loop 

Note: Please keep in mind this blog is a work in progress and ive learned quickly that teaching is alot harder than just following along . If something is explained poorly or you have a suggestion to reword a step please leave a comment below so we can make this the best resource possible for up and coming developers.

View the video tutorial:
               Text walk-through of this tutorial: Coming Soon!!!


Movies Gallery 2011 said...

Excellent pieces. Keep posting such kind of information on your blog. I really impressed by your blog.
Vee Eee Technologies| Vee Eee Technologies

Mary Brown said...


Online Java Training
Online Java Training from India

Cranes Varsity said...

Hey nice story... I love the way you presented whole story, Thanks for sharing such a useful information with us software testing institutes in bangalore | software testing courses in bangalore

Post a Comment