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
What type of camera is a cell phone camera
Sergeeva-Olga [200]

Answer:

A camera phone is a mobile phone which is able to capture photographs and often record video using one or more built-in digital cameras. It can also send the resulting image over the telephone function. The first commercial camera phone was the Kyocera Visual Phone VP-210, released in Japan in May 1999.

Explanation:

Hope this kinda helps you :)

3 0
3 years ago
Read 2 more answers
What are the five generations of computer software​
Lerok [7]

Answer:

1st gen: Vacuum Tubes(1940–1956)

2nd gen: Transistors(1956–1963)

3rd gen: Integrated Circuits: (1964–1971)

4th gen: Microprocessors (1971–PRESENT)

5th gen: Artificial Intelligence (present)

Explanation:

8 0
2 years ago
What these large numbers in unemployment could mean long term for America?
riadik2000 [5.3K]

Answer:

Im twelve but i know something about economics. The more homeless the more free coupons the government give out which the middle and high class pay for. The more people the higher the taxes and inflation causing the middle class to shrink making only rich and poor people. The U.S. then will have more homeless.

Explanation: Larg bwain finking

6 0
4 years ago
If you wanted a computer to store a variable with the content of “110 Maple Street,” which data type would be most appropriate?
hichkok12 [17]

Answer:

string

Explanation:

string holds words while boolean only returns true or false and both binary and float  hold numbers

8 0
3 years ago
Read 2 more answers
What is HDLC flow control?​
Likurg_2 [28]
HDLC is a synchronous Data Link layer bit-oriented protocol developed by the International Organization for Standardization (ISO).
6 0
3 years ago
Other questions:
  • While Angela is making modifications to Katie’s Word document, she would like to inform Katie of the reasoning for the change. W
    10·1 answer
  • What will happen if you change data that is used in a formula
    10·1 answer
  • Match terms in the first column with the order descriptions in column two.
    11·1 answer
  • What is a block cipher algorithm that operates on 64-bit blocks and can have a key length from 32 to 448 bits?
    8·1 answer
  • And there you go <br> sorry its saying my thing is tooo small
    14·2 answers
  • Set methods are also commonly called _____ methods, and get methods are also commonly called _____ methods.
    6·1 answer
  • Write a method that returns a version of the given array where all the 10's have been removed. The remaining elements should shi
    9·1 answer
  • Limitations of systems analysis and design​
    13·1 answer
  • As you are discussing marketing with a client, you try to explain how individuals find sites. Which tool will you explain as the
    8·1 answer
  • Select the correct text in the passage.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!