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
write a program that count the number of occurences of string in the n-th padovan string p(n)   program in java // aakash , suraj , prem sasi kumar kamaraj college progr

The clustering regulates high scalability and availability. The basic considerations for servlet clustering are: 1. Objects opened in a session could be serializable to support

How much CPU time does an applet get? One of the few legitimate concerns about hostile applets is excessive use of CPU time. It is possible on a non-preemptively multitasking s

Inheritance - is the inclusion of state and behavior of a base class in a derived class so that they are accessible in that derived class. The key benefit of Inheritance is that


Project Description: Our project consists of a plain application, both for iPad/iOS (Newsstand app) and Android 4.x which will download PDF magazines from the internet, after ha

Describe Overriding Methods ? Assume that one day you've just finished your Car class. It's been plugged into your traffic simulation that is chugging along merrily simulating

What is PortableRemoteObject.narrow() method and what is used for?                Ans) Java RMI-IIOP gives a mechanism to narrow the the Object you have received from from your

What is the preferred organizational structure for the organization? Preferred Organizational Structure for organization is hierarchal. Where there is various departments inter

Create a program Using Constructors? The further program uses the constructor to initialize a car rather than setting the areas directly. class CarTest7 { public static voi