1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Delicious77 [7]
3 years ago
14

1. 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.
2. Create a test class to constuct and call the methods of your class.
3. Describe your class and demonstrate your code functions properly.

Computers and Technology
1 answer:
Ivanshal [37]3 years ago
8 0

Answer:

Explanation:

public class Main

{

public static void main(String[] args) {

 System.out.println("Test Class:");

 Name name = new Name("Dayanand","Ghelaro");

 System.out.println("First Name : "+name.getFirstName());

 System.out.println("Last Name : "+name.getLastName());

}

}

class Name{

   private String firstName;   // first name field

   private String lastName;    // last name field

   public Name(String firstName, String lastName){

       this.firstName = firstName;

       this.lastName = lastName;

   }// end of constructor

   public String getFirstName(){

       return this.firstName;

   } // end of method

   public String getLastName(){

       return this.lastName;

   }// end of method

}// end of Name class

You might be interested in
I NEED HEP QUICK
avanturin [10]

Answer:

O = (C2+C3+C4+C5)-81

Explanation:

5 0
2 years ago
How do you implement instruction level parallelism
netineya [11]

Answer:

To obtain substantial performance enhancements, we must exploit ILP across multiple basic blocks.

Explanation:

8 0
3 years ago
Can you please provide sample rexx code?
Aleks04 [339]

Answer:

/*  My first REXX program  */

say 'Hello world'

Explanation:

REXX is an OS/2 scripting language.

7 0
3 years ago
How do i open screenshots on school chromebook?
yuradex [85]

Answer:

you have to open your file explorer and open the screenshot folder.

Explanation:

3 0
2 years ago
Read 2 more answers
To track what level a player is on, you can create a simple variable and a block saying change level by 1 attached to the when g
marishachu [46]

Answer:

False

Explanation:

I did it on edgnuity also i got it right

5 0
3 years ago
Other questions:
  • What is the name of the table tools contextual tab that appears once you insert a table?
    8·2 answers
  • Need 9&10. Thank you! Btw it's due today.
    11·1 answer
  • The PRNG variable ___________ is defined in NIST SP 800-90 as a number associated with the amount of work required to break a cr
    7·1 answer
  • How does is make you feel when you're kind to others? What are some opportunities in your life to be more kind to your friends a
    9·1 answer
  • Host Y sends the first TCP ACK message for the transaction?<br><br> a. true<br><br> b. false
    9·1 answer
  • What are ya'll discords???
    10·2 answers
  • Multiply the following two Tom's Tiny floating-point format numbers (8-bit: sign bit, 3-bit 2's complement exponent, 4-bit fract
    12·1 answer
  • Can rank u r guys in rocket leagye
    13·1 answer
  • Which device do engineers use to drive a system of gears?
    15·2 answers
  • According to the test for x-ray film freshness, the film is fresh and has been properly stored and handled when the processed fi
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!