Modify user profile class, JAVA Programming

Modify your UserProfile class to meet the following requirements:

  1. It must include a field called wall to store an ArrayList of wall posting objects. It must also provide a getter called getWall() that returns the ArrayList of wall posting objects. The list should initially be empty for a newly created UserProfile.
  2. It must provide a method called postToWall() that takes two parameters: the author of the posting (a user profile, not a string) and a string message. This method should add a new wall posting with the given contents.

Note that wall postings should be stored in reverse-chronological order, meaning that newly created posts should be stored at the beginning of the list, not at the end. Also, this method should ensure that the total number of posts does not exceed 20. Once the wall gets that full, delete the oldest post to make room for a new one. Study the API documentation for ArrayList to find suitable methods to accomplish this arrangement. You may assume that the clock is consistent, that is, postings created more recently will also have a more recent time stamp.

Posted Date: 3/13/2013 4:02:11 AM | Location : United States







Related Discussions:- Modify user profile class, Assignment Help, Ask Question on Modify user profile class, Get Answer, Expert's Help, Modify user profile class Discussions

Write discussion on Modify user profile class
Your posts are moderated
Related Questions
The Applet's life cycle functions are as follows: public void init() : Initialization function called only once by the browser. public void start() : Method called after

identify the possible classes and methods in the classes which can be used in a sales tracking system for a fast food restaurants

How can i draw E-R diagram

Write a program using local variable Public void someMethod( ) { int x; //local variable System.out.println(x); // compile time error } - Constructor - Doesn't

n this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, such

What are the advantages of multimedia presentations? Write any five. Following are the benefits of multimedia presentations: • Great tool for efficiently communicating ideas

Ask question #MBookshelves A library decides buy bookshelves to store its books and they need to determine the bookshelves’ heights and widths in order to minimize storage costs. T

#questionSmugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they

How many JSP scripting elements and what are they? Ans) Three scripting language elements are there: a)      declarations, b)      scriptlets, c)       expressions.

What is difference between time slicing and preemptive scheduling? Differences between preemptive and time scheduling are: In case of Preemptive scheduling the highest prior