help in java program

help in java program

please could you help me with my assignment I have to submit it on Monday 29 October please help me :(

Write a program to test the Person class defined below. Your test program should create
two instances of the class (each to test a different constructor) and test each of the methods. You are also required to illustrate the error in trying to access private data
members from the client class (for clarity temporarily change the private modifier to public
and test again).

class Person { // Data Members
private String name; // The name of this person private int age; // The age of this person private char gender; // The gender of this person // Default constructor public Person() { this("Not Given", 0, 'U'); } // Constructs a new Person with passed name, age, and gender. // example of explicit use of ââ?¬Å?thisââ?¬Â? (only for illustration) public Person(String name, int age, char gender) { this.age = age; this.name = name; this.gender = gender; }
// Returns the age of this person. public int getAge( ) { return age; } // Returns the gender of this person. public char getGender( ) { return gender; } // Returns the name of this person. public String getName( ) { return name; } // Sets the age of this person. public void setAge( int age ) { this.age = age; } // Sets the gender of this person. public void setGender( char gender ) { this.gender = gender; } // Sets the name of this person. public void setName( String name ) { this.name = name; } } // end class

View Answers









Related Tutorials/Questions & Answers:
help in java program
help in java program  please could you help me with my assignment I have to submit it on Monday 29 October please help me :( Write a program to test the Person class defined below. Your test program should
help with program - Java Beginners
Help with program  Simple Java Program  // Defining class Stars.java to print stars in certain orderclass Stars{// main() functionpublic static void main(String[] args){int a = 1, b = 5, c, d, i; // declaring 5 int type
Advertisements
program help - Java Beginners
program help  In the following code, I want to modify class figure..., Abstract Class In java programming language, abstract classes are those.... For read more information on java visit to : http://www.roseindia.net/java
need help with a program - Java Beginners
Java algorithm - need help with a program  Java algorithm - need help with a program
help needed for a program - Java Beginners
help needed for a program   i am having trouble understanding on what to code, so can some 1 help me out here. thanks in advance. Part I Write, compile and execute a Java program that displays the following prompts
Java Program HELP - Java Beginners
Java Program HELP  Hi I'm having trouble with this program, i keep getting errors. Can you help me. Thanks Write a program to create a file named "numbers.dat". Then create an algorithm that adds all even numbered integers
Java Program HELP - Java Beginners
Java Program HELP  Hi I'm having trouble with this problem, I keep getting errors. Write a program GuessGame.java that plays the game ?guess the number? as follows: Your program chooses the number to be guessed by selecting
need help with a program - Java Beginners
need help with a program   Part I An algorithm describes how... by the user. The output of the program should be the length and width (entered.... First you would need to make up the "test data". For this algorithm, the test data
java program help - Java Beginners
java program help  sir i just want to clarify one statement that i am... incometax which we have to make a program on java a company has employees who... ....write a program to perform this job.. Sir....how can we find income tax
Help with this program
Help with this program  Write a program that would do the following: 1) Read a String from the user. The String will be the following: "My grade is x" (where x is an integer between 0-9) 2) Get the String to integer by creating
Help with this program
Help with this program  Write a program that would do the following: 1) Read two Strings from the user 2) The user should input two integer numbers. 3) Convert the Strings to integers by creating objects and calling
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
need help on writing a program. - Java Beginners
Writing first Java Program  Hi, I need help to write my first Java Program other then Hello World! Thanks!!  Hi Thanks for choosing roseIndia to get your query solved. check given link to see the solution of your Java
please help me in a java program !! - Java Beginners
please help me in a java program !!  the porgram should use...://en.wikipedia.org/wiki/Kosaraju_algorithm) there are 4 classes in my program : Vertex... and run the program" i still need to modify the method kosaraju in the class Graph
need help with java program as soon as possible
need help with java program as soon as possible  So my assignment is to write a program that used while loops to perform 6 different things. 1. prompt the users to input two integers: firstNum and secondNum (firstNum must be less
please help me for this program - Java Beginners
please help me for this program   Write a program that asks the user for a starting value and an ending value and then writes all the integers (inclusive) between those two values. Enter Start: 10 Enter End: 14 10
need help creating a lift program - Java Beginners
need help creating a lift program  Classes, Methods, Constructors please i need help to create an elevator program Simulating an Elevator write an Elevator class containing various methods. Then, write a program
Help with an address book program! - Java Beginners
Help with an address book program!  I have a very long question, but please bare with me. I need help writing a program (or more like putting all the pieces together) that would represent a contact book. Here's what I need
Example to compile a java file with the help of the program
Example to compile a java file with the help of the program... are describing you the way to compile the java file with the help of the java program. The steps involved for compiling the java file from the program are described
can some help out on wrting this program. - Java Beginners
can some help out on wrting this program.  Write a Java program... and the price of the order computed to your program. NOTE: The first number on the file
need help with program
need help with program  To write a program to read a set of words from a file and return the following 1)Each word in the file against its frequency 2) the frequency should be in the descending order of the frequencies
multithreaded program help!!!!
multithreaded program help!!!!  Write a multithreaded program that calculates various statistical values for a list of numbers. This program... value. For example, suppose your program is passed the integers 90 81 78 95 79
need help with program
need help with program  To write a program where we can take two integer array as input,Find the missing number from array"B" has all the numbers from array"A" except one,and find the fastest way in doing
Need help with console program?
Need help with console program?  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). thanks in advance.   Here is an example that repeatedly
really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite... a Java program that displays the following prompts: Enter
Help with Temperature program
Help with Temperature program  I need help to write a GUI program to calculate the temperature. and here is the format Application that converts temperature between 3 different scales: Fahrenheit, Celsius and Kelvin. ââ?¬Â
C Program....PLEASE HELP
C Program....PLEASE HELP  For this assignment, you are to write a program that calculates points along a rhodonea curve, a.k.a. a mathematical rose..., and pointers. I am lost and need a little help starting please *int fillArray
Help with a maintenance tracking program.
Help with a maintenance tracking program.  The Pace Trucking Company... maintenance. The trucking company would like a program to allow the user to enter.... After the program asks for the number of trucks to be entered, users will enter
Easy Counting Java Program...Please Help? - Java Beginners
Easy Counting Java Program...Please Help?  As I said, I am a beginner at Java. I came across this problem that Im sure uses java. Could you please... someone PLEASE give me this code? I would really love to know this program! THANK
java program...need help as soon as possible!!! - Java Beginners
java program...need help as soon as possible!!!  Modify the Lexer (15.... 4. Print each token with line number READLINE: program { int i int j program left: 0 right: 6 line: 1 { left: 8 right: 8: line: 1 int
Pleae help me to give logic and code for this program - Java Beginners
Pleae help me to give logic and code for this program  Write a function that given the string ?original? create a new string ?dramatic? that has two...://www.roseindia.net/java/beginners/StringReverseUsingStringUtils.shtml
java program.. the question is scary ...please help - Java Beginners
java program.. the question is scary ...please help  Modify the Lexer..., etc. 4. Print each token with line number READLINE: program { int i int j program left: 0 right: 6 line: 1 { left: 8 right: 8: line: 1 int
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
Need help writing a console program
Need help writing a console program  I need help cant seems to figure it out! Write a program that consists of three classes. The first class will be the actual program. The second class will simply convert a string to lower
Need help in completing a complex program; Thanks a lot for your help
Need help in completing a complex program; Thanks a lot for your help  Hi, I am currently working on one program which works in this way. 1... no output. So please help me with this too. And also, I am using Runtime function
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.  HERES TEH QUESTION - I AM MISSING SOME..., ADDRESS AND ADMISSIONS CLASS PLEASE HELP!!! Write a Java program which
beginner need help with online ordering program please
beginner need help with online ordering program please  I have created a program for an online ordering system and now have to add error handling and a few other things my teacher doesn't teach well is there a template I can go
please help me in coding this given program
please help me in coding this given program  consider the below... are the prime numbers in ascending order write a program to find the nth term in this series. (i m unable to code this program..please provide solution
please help me in coding this given program
please help me in coding this given program  consider the below... are the prime numbers in ascending order write a program to find the nth term in this series. (i m unable to code this program..please provide solution
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Need in desperate help in writing a console program
Need in desperate help in writing a console program  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two
Need in desperate help in writing a console program
Need in desperate help in writing a console program  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two
Need in desperate help in writing a console program
Need in desperate help in writing a console program  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two
java help!
java help!   I need help starting off a program I am trying to write for class. The class should contain a private instance variable to represent temperature in Degrees Celsius and it should have the following methods
Help With Java...
Help With Java...  Write a java program that can take a positive integer greater than 2 as input and write out the number of times one must repeatedly divide this number by 2 before getting a value less than 2
Help with opening a text file upon closing a program.
Help with opening a text file upon closing a program.  I need some helping in figuring out something I want to do. I have this program... that file to open whenever the user exits the program. My code so far
help in java
help in java  Write an application that prompt the user to enter... the entered size. Java generates a NegativeArraySizeException if wou attempt to create.... At the end of your program ask the user to enter the index of the array to display
java help?
java help?  Write a program, where you first ask values to an array... (send in the array & return the counted value to the main program). Print out results in the main program   Hi Friend, Try the following code
help in java
help in java  Write a program that will evaluate simple expressions... by another number. The operators that are allowed are +, -, *, and /. Your program..., and so on. The program should end when the user enters 0 as the first number

Ads