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
How many times go you need to click the format painter button to apply copied formats to multiple paragraphs one right after the
Umnica [9.8K]
Double click would be enough
6 0
3 years ago
Read 2 more answers
What term is used to identify the visual interface that displays information it receives from the computer?
olga nikolaevna [1]
The answer to this question is A
7 0
4 years ago
According to your course, two benefits of a cloud-based system are_ and_
vodomira [7]
Data backup and collaboration.
4 0
4 years ago
Which category best represents: a student sends harassing emails to another student. The receiving student retaliates with a "fl
Dima020 [189]
It is considered C. cyber bullying
3 0
3 years ago
Read 2 more answers
Binary data is grouped together to represent symbols (e.g., text, pixels, etc.). Eight data bits can represent how many differen
Black_prince [1.1K]

Eight data bits can represent  64 symbols.

<h3><u>Explanation:</u></h3>

All the computer system can understand only the binary data system. It consists of only 0 and 1. These binary digits can be grouped together for the representation of symbols. 256 values can be represented by 8 bits, 10 bits represent 1024 values.  

The powers of two is considered as an important thing in this representation.Thus the eight bit of data can represent about 64 symbols. This is calculated by the power of two. The base is eight here. When 8 is multiplied with the power of two we get 64 symbols(8 * 8 =64).

8 0
3 years ago
Other questions:
  • Effective note-taking helps support<br><br> action.<br> distinction.<br> distraction.<br> retention.
    9·2 answers
  • True false you cannot fill in a callout​
    14·1 answer
  • If a user has just added a simple triangle shape into a diagram, how can the triangle be adjusted? Check all that apply. by maki
    6·2 answers
  • What is the purpose of ergonomics in the workplace? A.Keep workers safe and injury free
    5·2 answers
  • Which of the following is true about main content? Select all that apply.
    10·2 answers
  • Arctic Gear LLC. recently adopted a new ERP​ system, but quickly found that it​ wasn't a perfect fit with their existing procedu
    14·1 answer
  • I want to start a debate about something
    9·2 answers
  • In PowerPoint, a picture might be a photograph, a shape you draw, a piece of clip art, or an illustration created using a graphi
    7·2 answers
  • A network of computers that provides access to information on the web.
    15·2 answers
  • Identify and state the value of hardware components​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!