Answer:
import java.util.*;
public class Country
{
public static void main(String args[])
{
char ch,temp;
int flag = 0;
String country;
ArrayList<String> countries = new ArrayList<String>();
Scanner sc = new Scanner(System.in);
do
{
System.out.println("enter the country you have visited:\t");
country = sc.next();
for(int i=0;i<countries.size();i++)
{
if(countries.get(i).equals(country))
{
System.out.println("you have already entered the country");
flag = 1;
break;
}
}
if(flag == 0)
{
countries.add(country);
flag = 0;
}
System.out.println("want to add another country(y/n):\t");
ch = sc.next().charAt(0);
}while(ch!='n');
Collections.sort(countries);
System.out.println("Countries you have visited:\t"+countries);
System.out.println("Total number of contries visited:"+countries.size());
}
}
Explanation:
The creating subclass of an existing class different from copying the code from the existing class to a new file because one involves existing class while the other involves a new class.
<h3>What is superclass?</h3>
This is known to be creating a class, instead of declaring completely new members, then a person often designate that the new class to inherit the members of an existing class - Uses Existing class.
<h3>What is subclass?</h3>
In the creating a class, instead of declaring what we call a completely new members, a person can designate that the new class to be able to inherit the members of an existing class. Uses New class.
Hence, The creating subclass of an existing class different from copying the code from the existing class to a new file because one involves existing class while the other involves a new class.
Learn more about subclass from
brainly.com/question/19260275
#SPJ1
Answer:
D. Point out the negative consequences of the behavior, so they see that the negative aspects do outweigh the positive aspects
Explanation:
The difference between analog and digital is in how the information/data is measured: Analog technology uses data that is continuous and the goal is to capture a likeness of reality. Digital technology uses sampling to encode the data and then reproduces it as closely as needed.
Hope this help young children
Answer:
the answer is computer, phone, laptop
Explanation: that is all ik