Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: HELP WITH PROGRAM

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation HELP WITH PROGRAM

    it keeps telling me : illegal star of expression
    Can someone help me arrange my short program . Thanks


    package Logic;

    public class Client{

    private String id;
    private String name;
    private String surname;
    private String dob;
    private int mobile;

    public Client()
    {
    }


    public Client(String id, String name , String surname , String dob , int mobile){
    this.id=id;
    this.name=name;
    this.surname=surname;
    this.dob=dob;
    this.mobile=mobile;
    }

    public void setId (String id){
    this.id= id;
    }

    public String getId() {
    return id;
    }

    public void setName (String name){
    this.name= name;
    }

    public String getName() {
    return name;
    }

    public void setSurname (String surname){
    this.surname= surname;
    }

    public String getSurname() {
    return surname;
    }

    public void setDob (String dob){
    this.dob= dob;
    }

    public String getDob() {
    return dob;
    }

    public void setmobile (int mobile){
    this.mobile=mobile ;
    }

    public int getmobile() {
    return mobile;
    }



    public String printClient ()
    {

    return "--- Client Record ---";
    "nID no: " + idNo+
    "nName: " + name+
    "Surname: " +surname+
    "nDOB " + DOB+
    "nMobile:" + mobile+

    }
    }


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: HELP WITH PROGRAM

    Welcome to Java programming forums.
    Wrap your code in code tags.
    Always describe your problem precisely so that you could get help.
    return "--- Client Record ---";
    "nID no: " + idNo+
    "nName: " + name+
    "Surname: " +surname+
    "nDOB " + DOB+
    "nMobile:" + mobile+
    You will be getting this error for this line hopefully. In Java semicolon(;) is used when a statement is terminated. Look into this piece of code carefully and you will solve it on your own.
    Last edited by jps; December 3rd, 2012 at 01:11 PM. Reason: Disabled smiley
    Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.

    - Henry Ford

Similar Threads

  1. Program goes into infinite compilation. University project - Library Program.
    By clarky2006 in forum What's Wrong With My Code?
    Replies: 35
    Last Post: November 10th, 2012, 02:56 PM
  2. Replies: 1
    Last Post: July 8th, 2012, 10:23 AM
  3. how to run a java program..when the program using jar
    By miriyalasrihari in forum Java Theory & Questions
    Replies: 2
    Last Post: May 17th, 2012, 10:04 AM
  4. Program to launch and mirror another program
    By hayate in forum Java Theory & Questions
    Replies: 13
    Last Post: March 8th, 2012, 11:47 PM
  5. Help with class program!!! STUCK! Program not doing what I Want!!!
    By sketch_flygirl in forum What's Wrong With My Code?
    Replies: 7
    Last Post: April 4th, 2011, 07:29 AM