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
Determine whether the compound condition is True or False.
Viktor [21]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The given compound statement are:

4 < 3 and 5 < 10

4 <3 or 5 < 10

not (5 > 13)

4 < 3 and 5 < 10  this statement is false because "and" logical operator required that both operand (4<3) and (5<10) are true. Statement (4<3) is a false statement so this statement is false. "and" operator becomes true when all its inputs are true otherwise it becomes false.

4 < 3 or 5 < 10  this statement is true because "or" logical operator to be true if one of its input is true and false when all inputs are false. so in this compound statement, the first statement is false and the second statement is true. so this compound statement is true.

not(5>13) this compound statement is true because it has "not" operator and "not" operator makes a false statement to true and vice versa. so (5>13) is a false statement, and when you append "not" operator before it, then this compound statement will become true statement, so this is a true statement.

7 0
2 years ago
Discuss the purpose purpose of of network attached storage devices
valentinak56 [21]

Answer:

A network attached storage (NAS) device is a server connected to a network with the sole purpose of providing storage. NAS devices often use a RAID configuration. An external hard disk is a separate freestanding hard disk that connects with a cable to a USB or FireWire port on the system unit or communicates wirelessly. External hard disks have storage capacities up to 4 TB and more. A removable hard disk can be inserted or removed from a built-in or external drive. Removable hard disks have storage capacities up to 1 TB. A disk controller consists of a special-purpose chip and electronic circuits that control the transfer of data, instructions, and information from a disk to and from the system bus and other components in a computer. A hard disk controller may be part of the hard disk on the motherboard, or it may be a separate adapter card inside the system unit.

Please Mark Brainliest If This Helped!

5 0
2 years ago
How do Design Tools build robots for a Robotic Process Automation (RPA) application?
Anna11 [10]

Answer:

To build a robot create a goal, then center of excellence and then set the rightful infrastructure.

Explanation:

Robotic Process Automation (RPA) is a software technique in which it makes easy to deploy, build and manage software robots that copy the human's nature with digital system and software.

5 0
2 years ago
What did Sniff and Scurry find while Hem and Haw were still hesitating? What did Haw write on the wall and how does this apply t
Minchanka [31]

The thing that Sniff and Scurry find while Hem and Haw were still hesitating was a big supply of  a New Cheese.

The thing that Haw write on the wall and how does this apply to us in everyday life is  “If a person Do Not Change, they can be able to go Extinct.”

<h3>What is the thing about  Sniff and Scurry?</h3>

Sniff and Scurry were well on their way while Hem and Haw were still deciding what to do. They focused exclusively on locating New Cheese. They discovered a huge amount of New Cheese, which is what they were seeking for.

Note that Haw began to scribble words of encouragement on the walls as he made his way through the Maze, both for himself and to inspire Hem should he decide to change his mind and leave.

Learn more about Change from

brainly.com/question/25594630

#SPJ1

5 0
10 months ago
State the name of each of the storage devices described below.
luda_lava [24]
It’s b i believe tgghtuyghtgt
7 0
3 years ago
Other questions:
  • Which of the following are incorrect safety precautions for equipment operators? A. Drive equipment or vehicles on grades or roa
    7·2 answers
  • What are an administrator's choices for managing file permissions on a drive formatted as fat32?
    10·1 answer
  • You are configuring a switch that has three hosts attached to FastEthernet 0/2 through 0/4. All three hosts are part of a public
    10·1 answer
  • When adding clip art to a slide you are limited to the pictures stored on your computer?
    14·1 answer
  • What effect on total current flow will a shorted series component have in a series-parallel circuit?
    8·1 answer
  • Friday Night Funkin Fans, does this count as a leak if I share it?
    13·2 answers
  • 4.8 code practice question 2
    10·1 answer
  • Yooooooooooooooo
    5·2 answers
  • Which of the following is the most significant result of technological innovation?
    10·2 answers
  • The people, procedures, hardware, software, data, and knowledge needed to develop computer systems and machines that can simulat
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!