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
STAY AWAY FROM AND REPORT mariaivanovaloveyou!!!!!!! SHE IS A BRAINLY USER AND KEEPS POSTING INAPPROPRIATE PICTURES OF HER BODY
Bond [772]

Answer:

Yep, saw her posts. Thanks for the warning though. I reported one of her posts. It's just another example of how desperate people are and what measures they will take to get attention. She'll probably be banned soon

Explanation:

Thank you for the warning though. I hope this reaches more people.

7 0
2 years ago
The answer is family and friends
nadya68 [22]
Family and Friends



you said the answer was that, soooooo
5 0
3 years ago
Read 2 more answers
Which one of these is not a way of identifying that a website is secure?
FinnZ [79.3K]

Answer:

B

Explanation:

all url's begin with https://

5 0
3 years ago
Complete the sentence.
Luda [366]
The answer is Tablets
6 0
3 years ago
Exercise 3.16.4: Happy Face Solita
enot [183]

first do a happy face and a circule thats it

7 0
3 years ago
Other questions:
  • A software program that enables users to find and display information stored as html pages on the internet is a(n) ____.
    5·1 answer
  • divide the input array into thirds (rather than halves), recursively sort each third, and finally combine the results using a th
    15·1 answer
  • What does limited access to a document mean?
    14·2 answers
  • Who have a ps4 ?<br> Who have 2k20? <br> Are you good a 2k20 ? <br> Add me on Ps4 eoKyriie
    13·2 answers
  • If Windows does not automatically detect a newly added device, to get the device recognized and the drivers installed, you shoul
    8·1 answer
  • CMS is a content management system that collects, organization, publishes, and manages creative content. Right...?
    9·1 answer
  • How to find out what windows version i have?
    10·1 answer
  • Question 5 (frue/False Worth 3 points)
    7·1 answer
  • Letter only ^_____^!
    8·1 answer
  • 3. Special keys labelled Fl to F12.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!