Question

JAVA CODE Provide Java code for a simple class of your choice. Be sure to include...

JAVA CODE

Provide Java code for a simple class of your choice. Be sure to include at least one constructor, two methods and two fields. The fields should be private.

Create a test class to constuct and call the methods of your class.

Describe your class and demonstrate your code functions properly.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
JAVA CODE Provide Java code for a simple class of your choice. Be sure to include...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Java code for the following inheritance hierarchy figure.. 1. Create class Point, with two private instance...

    Java code for the following inheritance hierarchy figure.. 1. Create class Point, with two private instance variables x and y that represented for the coordinates for a point. Provide constructor for initialising two instance variables. Provide set and get methods for each instance variable, Provide toString method to return formatted string for a point coordinates. 2. Create class Circle, its inheritance from Point. Provide a integer private radius instance variable. Provide constructor to initialise the center coordinates and radius for...

  • Create a java class that implements BagInterface using singly linked data. Name this new class LinkedBag....

    Create a java class that implements BagInterface using singly linked data. Name this new class LinkedBag. Be sure to include a default constructor to initialize the private members of the class. Test that your code works properly. BagInterface includes the methods:  public int getCurrentSize(); public boolean isEmpty(); public boolean add(T newEntry); public T remove(); public boolean remove(T anEntry); public void clear(); public int getFrequencyOf(T anEntry); public boolean contains(T anEntry); public T[] toArray();

  • Write an ADT named circle in java containing the following. Include data: radius (double) Include methods:...

    Write an ADT named circle in java containing the following. Include data: radius (double) Include methods: A no-argument constructor A constructor that sets the data to passed values Getters and setters for each piece of data getArea (Math.PI * radius * radius … try using a Math method here) getDiameter (radius * 2) getCircumference (2 * Math.PI * radius) A toString( ) method to display the object data Include Javadoc comments for the class and every method, and generate the...

  • Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super...

    Java Program (PLEASE PROVIDE SCREENSHOT OF THE CODE) Create a class Person which is a super class. The class includes four private String instance variables: first name, last name, social security number, and state. Write a constructor and get methods for each instance variable. Also, add a toString method to print the details of the person. After that create a class Teacher which extends the class, Person. Add a private instance variable to store number of courses. Write a constructor...

  • Go to the Java API and review the Rectangle class briefly. As directed below, create a...

    Go to the Java API and review the Rectangle class briefly. As directed below, create a subclass of the Rectangle class called BetterRectangle as described below. Create another class called RectangleTester, which fully tests the BetterRectangle, by displaying a menu that allows a user to process data for multiple rectangles until they choose to quit. Be sure to include sample runs as block comments in your tester source code file. P9.10 The Rectangle class of the standard Java library does...

  • Here is a sample run of the tester program: Make sure your program follows the Java...

    Here is a sample run of the tester program: Make sure your program follows the Java Coding Guidelines. Consider the following class: /** * A store superclass with a Name and Sales Tax Rate */ public class Store {      public final double SALES_TAX_RATE = 0.06;      private String name;           /**      * Constructor to create a new store      * @param newName      */      public Store(String newName)      {           name = newName;      }     ...

  • Bottom section is the what they expect in the code in java Create a class in...

    Bottom section is the what they expect in the code in java Create a class in JobApplicant.java that holds data about a job applicant. Include a name, a phone number, and four Boolean fields that represent whether the applicant is skilled in each of the following areas: word processing, spreadsheets, databases, and graphics. Include a constructor that accepts values for each of the fields. Also include a get method for each field. The get method should be the field name...

  • ****Here is the assignment **** Purpose: To write an Object-Oriented application that creates a Java class...

    ****Here is the assignment **** Purpose: To write an Object-Oriented application that creates a Java class with several instance variables, a constructor to initialize the instance variables, several methods to access and update the instance variables’ values, along with other methods to perform calculations. Also, write a test class that instantiates the first class and tests the class’s constructor and methods. Details: Create a class called Rectangle containing the following: Two instance variables, An instance variable of type double used...

  • JAVA programing Question 1 (Date Class):                                   &nbsp

    JAVA programing Question 1 (Date Class):                                                                                                     5 Points Create a class Date with the day, month and year fields (attributes). Provide constructors that: A constructor that takes three input arguments to initialize the day, month and year fields. Note 1: Make sure that the initialization values for the day, month and year fields are valid where the day must be between 1 and 31 inclusive, the month between 1 and 12 inclusive and the year a positive number. Note 2:...

  • (i) Create a class square with attribute (integer) length which defaults to 5. Provide member functions...

    (i) Create a class square with attribute (integer) length which defaults to 5. Provide member functions that calculate the perimeter (4 * length) and the area (length*length) of the triangle. Also provide set and get functions for the length attribute. The set function should verify that length is between 0.0 to 100. Your class should also provide a display function that draws the aquare using * character. For example, if length = 5, the display function should draw             *****...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT