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
Create an application for Koch’s Cottages, a weekend getaway resort that rents cottages and boats to use on the local lakenimum 100 words accepted#

Explain what is Object in JAVA language? They are foundation of object oriented language. They are data structure holds data fields and properties and methods

Using Fork() and Exec() or Clone(), create four child processes. Load the same "Hello" program in each process after creation. This program should behave differently in each pro

Why should we, as computing professionals, be interested within studying the social implications of our creations? This is important Because of remaining the track of money wis

Polymorphism - defines the ability of a single variable of a provided type to be used to reference objects of different types, and automatically call the method that is specific

JSP simply gives a Page which may contain markup, embedded Java code, and tags which encapsulate more complicated logic / html. JSF may use JSP as its template, but gives much more

Extend the given drawing program (the version that allows undo and redo) as follows: a) Allow the user to select font and font size; user should also be able to boldface, underl

List down the names of two array techniques available in JavaScript. The two techniques thata rae available in java script is: 1. sort( ) [sorts elements within alphabetical

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

Describe Polymorphism? Polymorphism can be referred as one name many forms. It's the ability of methods to behave differently, depending upon object who is calling it. Key feat