TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Alex
NA
55
16.3k
Java, pls need help with arrays...who to create add method
Sep 24 2013 7:36 PM
public class EntityModel {
/**
* The model can only store up to MAX_RECORDS
*/
public static final int MAX_RECORDS = 10000;
/**
* The array storing the records
*/
protected Entity[] allRecords;
/**
* The number of records being stored
*/
protected int totalRecords;
/**
* The current record index. The main purpose of the class is to
* maintain this.
*/
protected int current;
/**
* A count of the number of records that have been marked for deletion
*/
protected int delRecCount;
// CONSTRUCTORS
/**
* Creates a EntityModel capable of storing <var>MAX_RECORDS</var> using
* an array
* <p>
* The current position is set to -1 (undefined)
*
* Creates the array
* <Initialises the totalRecords to zero
* Initialises the delRecCount to zero
* Sets current to be -1
*
*
*/
public EntityModel() {
//TODO
}
// INSERTING RECORDS
public Entity add(Entity entity) {
//TODO
return null; //remove or modify this line as needed
}
Reply
Answers (
4
)
action performance
Instantiate class exception