Answer:A conversation between co-workers
Explanation:
Answer:
The delimiter use is "::".
Explanation:
The Java inbuilt String.split( ) function is use to split a String into an array of String.
The split( ) takes delimiter as arguments/parameter which determines at which point the string is to be broken down into different part/token.
From the above code snippet;
Each line in the file a.txt that is not null is splitted using the statement below:
String[ ] v = line.split("::");
The line is splitted using "::" as delimiter and the resulting array is then assigned to the variable 'v'.
For instance, a line in the file could take the form:
John::Smith::Music
When it is splitted,
String lname = John;
because lname make reference to index 0 of the array.
String fname = Smith;
because fname make reference to index 1 of the array.
String dept = Music;
and dept make reference to index 2 of the array.
False. The clutch only exists in vehicles with manual transmissions.
Answer:
The program to this question can be given as:
Program:
public class Main //define class.
{
public static void main(String[] as) //define main method.
{
int n=5; //define variable n and assign positive value.
int i,j; //define variable
for (i = 7; i>=1; i--) //outer loop.
{
for (j = 0; j< i; j++) //inner loop.
{
System.out.print("*"); //print asterisks.
}
System.out.println(); //line break.
}
}
}
Output:
*****
****
***
**
*
Explanation:
The description of the above code can be given as:
- In the above java programming code firstly we define a class that is "Main". In this class we define a main method in the main method we define a variables that is "n" in this variable we assign a positive value. The we define another integer variable that is i,j this variable is used in the loop.
- Then we define a loop. for prints asterisks values in reverse triangle, we nested looping concept. In nested looping, we use in loop in this loop we use the i and j variables that print the asterisks value.