1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
m_a_m_a [10]
3 years ago
14

import java.io\.\*; import java.nio.file\.\*; public class TestFileReader { public static void main(String[] args) { Path p = Pa

ths.get("a.txt"); try (BufferedReader in = new BufferedReader( new FileReader(p.toFile()))) { String line = in.readLine(); while (line != null) { String[] v = line.split("::"); String lname = v[0]; String fname = v[1]; String dept = v[2]; System.out.println(fname + " " + lname + ", dept " + dept); line = in.readLine(); } } catch (FileNotFoundException e) { System.out.println("File not found."); } catch (IOException e) { System.out.println("I/O error."); } } } (Refer to code example 15-1.) What delimiter is used to separate fields in the a.txt file?
Computers and Technology
1 answer:
Charra [1.4K]3 years ago
6 0

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.

You might be interested in
Ally is taking a photograph of her friend. What is the orientation of her phone's screen?
In-s [12.5K]

Answer:

portrait

Explanation:

?

8 0
3 years ago
As a student, why do you need to know and follow the steps printing a <br><br>document?​
Kazeer [188]
So I am able to print my math notes and keep up in geometry.
7 0
3 years ago
Read 2 more answers
12) The Windows utility returns your computer to the state it was in when it came from the factory. Erase Refresh Reset Backup N
Ludmilka [50]

Answer:

Reset

Explanation:

3 0
3 years ago
which button will allow you to insert quotes and notes into text into a document​ A comment B compare C research d margins
inysia [295]

Answer:

D margins

Explanation:

mark brainlist

3 0
3 years ago
A series of events that gets the computer ready for work is known as what?
DedPeter [7]
I think the answer is the third one...
7 0
4 years ago
Read 2 more answers
Other questions:
  • What is the purpose of look up tables in spreadsheet software apex
    13·1 answer
  • Ethan is a systems developer. He is working on a system where he will implement independent solutions for different processes. W
    14·1 answer
  • Increasing your margins will increase the amount of space you have to type text on your document. Please select the best answer
    10·1 answer
  • Let f and g be two one-argument functions. The composition f after g is defined to be the function x 7→ f (g (x)). Define a proc
    15·1 answer
  • If number is 20, what is printed to the console after this code is executed?
    13·1 answer
  • Users are reporting Internet connectivity issues. The network administrator wants to determine if the issues are internal to the
    15·1 answer
  • The ____ data source class that reduce your need for accessing individual Data Provider class when you are connecting to an Acce
    15·1 answer
  • Need help completing this coding assignment.
    11·1 answer
  • how does the use of data abstraction manage complexity in program code? how does using lists make a program easier to develop an
    5·1 answer
  • Kyle has a notebook for each of his 5 classes. He puts 6 stickers on each notebook. There are 10 stickers on each sheet. How man
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!