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:
Answer:
True
Explanation:
The class Math include mathematical functions such as sin(), cos(), tan(), abs(), etc
If the given statement is not written, each of the math function will be written as (take for instance, the sin() function):
<em>Math.sin()</em>
<em></em>
But after the statement has been written (it implies that the Math library has been imported into the program) and as such each of the mathematical function can be used directly.
So instead of <em>Math.sin(), </em>you write <em>sin()</em>
Answer:
The cloud-based LinkedIn automation tool makes life easier for you by automating functions like sending connection requests, liking and commenting on posts, sending customized messages, and much more.
Answer:
True
Explanation:
You can set variables and make method functions.