Answer:
public class Invitation
{
private String hostname;
private String address;
public Invitation(String n, String a)
{ // constructor that accepts two strings.
hostname = n;
address = a;
}
public String getHostname()
{
return hostname;
}
public void setAddress(String a)
{
address = a;
}
public String invite(String guest)
{
return "Hello" +guest+ ", you are invited to my party at " +address+". "+hostname+".";
}
public Invitation(String host, String address)
{
this.address = address;
this.hostname = host;
}
}
Explanation:
The Java program defines a class called "Invitation". The class constructor has two string arguments or parameters for the host of the event and the address. The invite method is used to generate the string invite message with the name of the guest as the argument. Use the "setAddress" method to set a new location of the event and the "getHostname" to get the name of the event host.
When Libby wrote the email to her friend, she typed the '@' symbol. When pressing SHIFT and 2 together, it pastes this aforementioned symbol. However, there isn't any specific name for the symbol. As a matter as fact, there are several names that this symbol goes by.
The most famous name this symbol is called is the "at symbol" or the "at sign". In terms of a formal name, "commercial at" would be a good one.
Here's an example with the symbol:
[email protected]
This is essentially telling the email server where to send your email. From this, they'll know it's located at brainly.com! It's pretty neat.
Answer:
Explanation:
Since all of the items in the array would be integers sorting them would not be a problem regardless of the difference in integers. O(n) time would be impossible unless the array is already sorted, otherwise, the best runtime we can hope for would be such a method like the one below with a runtime of O(n^2)
static void sortingMethod(int arr[], int n)
{
int x, y, temp;
boolean swapped;
for (x = 0; x < n - 1; x++)
{
swapped = false;
for (y = 0; y < n - x - 1; y++)
{
if (arr[y] > arr[y + 1])
{
temp = arr[y];
arr[y] = arr[y + 1];
arr[y + 1] = temp;
swapped = true;
}
}
if (swapped == false)
break;
}
}