Create a new record

Posted on 2004-03-31
Last Modified: 2010-03-31
i'm new to java, so can anyone please help me?
i'm making an address book program and it has
first name
last name
street adress
post code
phone number

can some one please tell me how to create a record of list?

thanks very much

Question by:atjendrasa
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 86

Accepted Solution

CEHJ earned 50 total points
ID: 10723278
You mean a list of record?

We can't do classwork here btw - only help you with work that you've produced

Expert Comment

ID: 10723340
something to get you started....but you have to do the rest your self

public class  myRec
    String firstname, lastName,streetAddress,postCode;
    int phoneNum;
  //or String phoneNum; depending on the format

   String getfirstName(){
    return firstName;
   void setfirstName(String fn){
    // and other get and set methods

myRec newrec= new myRec();

ArrayList myArrayofRec= new ArrayList();


LVL 86

Expert Comment

ID: 10723447
That should follow conventions thus:

public class Entry {
      private String firstName;
      private String lastName;
      Entry(String firstName, String lastName) {
            // other fields needed too
            this.firstName = firstName;
            this.lastName = lastName;

      public void setFirstName(String firstName) {
        this.firstName = firstName;

      public String getFirstName() {
        return firstName;

      public void setLastName(String lastName) {
        this.lastName = lastName;

      public String getLastName() {
        return lastName;

LVL 86

Expert Comment

ID: 10723454

>>Entry(String firstName, String lastName) {

should be

public Entry(String firstName, String lastName) {

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hibernate example using maven 12 106
SequenceInputStream example 3 37
Eclipse for Java EE development 2 68
glassfish admin console 1 47
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question