Answer:
Public int getHeight(){
return height;
}
public int getWidht(){
return widht;
}
public int setHeight(int change){
height = change;
}
public int setWidht(int change){
widht = change;
}
public int getPerimeter(){
int perimeter = 2 ( getWidht() + getHeight ());
return perimeter;
If the width is 10 and height 4, the perimeter should be 28.
Explanation:
An accessor in Java is a method that is used to get the value of an object variable. The program above has three accessor methods, getHeight, getWidht and getPerimeter.
Mutators are methods that is used to change of mutate the value of object variables. They are denoted or identified by the set prefix in their names. From the class code, the mutator are setHeight and setWidht.
Answer:
Following are the code to the given question:
import java.util.Scanner;//import package
public class OrderStrings // defining a class OrderStrings
{
public static void main(String[] args) //defining a main method
{
Scanner scnr = new Scanner(System.in);//defining a Scanner class object
String firstString;//defining a String variable
String secondString; //defining a String variable
firstString = scnr.next();//input value
secondString = scnr.next();//input value
if (firstString.compareTo(secondString) < 0)//use if to compare sting value
System.out.println(firstString + " " + secondString);//print sting value
else//else block
System.out.println(secondString + " " + firstString);//print sting value
}
}
Output:
rabbits capes
capes rabbits
Explanation:
In this code a class "OrderStrings" is defined inside the class the main method is defined that declares the two string variable that uses the input method to input the string value and after input, it uses the conditional statement. Inside this compareTo method is declared that compare string value and prints the string value.
Answer:
There are some benefit of using a contact group.
Explanation:
An email address collection consists of a contact group (formerly known as a "distribution list."). You can send an E-mail or invitation to meet to all addresses at the same time by using a contact group. In the messages, task requests, requests for meetings, and other contact groups you can include contact groups. Another advantage of contact groups is that they categorize your contacts so that a particular person can be found more easily in future. Depending on how far you want to reach with your contact organization, you can contact one group or more groups
In the Declaration of Independence it states, "To secure these rights, governments are instituted among men deriving their just power from the consent of the governed. Whenever any form of government becomes destructive of these ends, it is the right of the people to alter or abolish it."
What Enlightenment idea is reflected in this passage?