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
Also considered a custom style, ____ is the most flexible way to define a style.
zhuklara [117]
Also considered a custom style, class is the most flexible way to define a style
3 0
4 years ago
Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the te
just olya [345]

Answer:

The answer is "Option 2".

Explanation:

In HTML5, text inputs use an autofocus attribute, which, when the page is loaded, uses a template to concentrate primarily on text fields. This attribute is a Boolean property that represents the HTML autofocus attribute, showing if the related <select> element will receive an output focus whenever the page loads if it is overruled by the user. An only form-associated entity can have this property specified in a text.

5 0
3 years ago
What does the following code do?
olasank [31]

Answer: what is this?

Explanation:

6 0
3 years ago
I need this nowww!!!!
Ilya [14]

Answer:

b,c

Explanation:

4 0
3 years ago
Several users are required to transfer files among themselves in a conference room. No APs are available for connections to the
lana66690 [7]
5272838yiwosysbkwhvsjdxbzb
8 0
3 years ago
Other questions:
  • A manufacturer of machine tools creates a spreadsheet of tools and their cost. The spreadsheet has four fields: name of the tool
    10·2 answers
  • The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
    11·1 answer
  • If you cannot see _______________, you are in the truck driver's blind spot and cannot be seen.
    7·1 answer
  • The following are types of numbers except one. Select the one which is not an integer.
    11·1 answer
  • What does HTML stand for?
    6·2 answers
  • What are the factors affecting the life of ballast? Explain.​
    15·1 answer
  • Order the steps to add a recommended chart in excel.
    5·2 answers
  • Q Basic program write a program in Q Basic to find the cost of 10 pens when the cost of 15 pens is 75 use unitary method to find
    8·1 answer
  • Renée’s job entails using a company laptop to constantly open other peoples’ workbooks, sorting the data, importing a new sheet
    15·1 answer
  • A numeric literal that is written with a decimal point is called a ________. real number floating-point value decimal literal do
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!