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
Computer is created by aliens?!
andriy [413]
The computer was invented by <span>Tom Warburton.</span>
7 0
4 years ago
Which of the statements below are true about Digital Signatures?
Leokris [45]

Answer:

The answer is "Option a, and c".

Explanation:

Following are the description of the Digital Signature choices:

  • To change the physical transportation of paper or link files in the computerized messaging system, some processes should be identified and utilized in digital signatures, which enables documentation to be validated unforgivably.
  • Using public-key cryptography, digital signatures, that's an exquisite system, that's why options a and b are correct.
  • Digital signatures are not a central authority, that's why the option B is wrong.
5 0
3 years ago
You are designing a wireless network for a client. Your client needs the network to support a data rate of at least 54Mbps. In a
mariarad [96]

Answer:

The best choice is 802.11a.

Explanation:

The most common option, that is widely used in home internet is 802.11b, however, this only supports a max speed of 11Mbps.

802.11a supports up to 54Mbps and it has regulated frequencies that prevent interference from other devices, such as the wireless system that your client already has. This option is more expensive, and its signal has issues going through walls and rooms but still, it is the one that fits him the most.

4 0
3 years ago
Harold wants to create a design that would depict the innocent and evil sides of human nature. Which colors can Harold use to de
belka [17]

Answer:

Usually good and evil are depicted as black and white or red and white. White being good, or pure.

Explanation:

8 0
3 years ago
A telecom company wants to extend their horizontal cables over a distance of 510 meters. Which cable should they use?
Volgvan
They should use fiber cable because it is faster and more reliable
8 0
3 years ago
Other questions:
  • Write the definition of a method named printPowerOfTwoStars that receives a non-negative integer n and prints a string consistin
    10·1 answer
  • Use this option to view your presentation as your audience will see it. a.File menu b.Play button c.Slide Show button d.Tools me
    6·2 answers
  • The _________ check is a type of hardware control that involves adding a "1" or a "0" to the end of every 8 bit byte such that t
    11·1 answer
  • There are several factors that can substantially affect the consumer search process. Match the factor with an example of how the
    5·1 answer
  • Choose two browsers and compare their security features.
    5·1 answer
  • What type of account provides the same functions as managed service accounts but can be managed across multiple servers as in a
    8·1 answer
  • What is computer generation.<br>name that generations ​
    9·2 answers
  • Describe how to find and replace a text in a document​
    13·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • Steps for Saving and opening a document.​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!