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
Technological advances have made cyberbullying
Tamiku [17]

Answer:

ok

Explanation:

6 0
3 years ago
कम्प्युटर को पहिलो पुस्ता भनेको के हो?​
Oksi-84 [34.3K]

Answer:

Look up Charles Babbage. He built a machine that is viewed as the predecessor of the modern computer.

3 0
3 years ago
Read 2 more answers
​some forms use a _____ that contains icons or buttons that represent shortcuts for executing common commands.
Galina-37 [17]

GUI, AKA Graphical User Interface

3 0
2 years ago
Describe the data update difference between operational and analytical data.
crimeas [40]

Operational data is used to sustain applications that help facilitate operations.

These databases are directed to as application-oriented. Analytical data is used to examine one or more business areas, such as sales, costs, or profit

<h3>What is the distinction between operational and information-analytical systems?</h3>

Operational systems are prepared to deal with the running values of data. Informational Systems deal with the collection, collection, and deriving of information from data.

<h3>What is the distinction between operational and analytical reporting?</h3>

Analytical reporting is introduced toward supporting the strategic and preparing functions of senior management.

Functional reporting is oriented toward helping the day-to-day organizational functions.

To learn more about Operational data, refer

brainly.com/question/22670650

#SPJ4

7 0
1 year ago
Jenn wants to assign a value to the favorite car variable: favoriteCar = Toyota but gets an error message. What does she need to
Bumek [7]

Answer:

The correct answer is: Option d: Put Quotation marks around the string.

Explanation:

The names of things or places or cars are usually in the form of words or sentences. The words or sentences are stored in string datatype.

Quotation marks are used to deal with strings in programming languages.

Hence,

The correct answer is: Option d: Put Quotation marks around the string.

3 0
3 years ago
Other questions:
  • 3.
    13·1 answer
  • The ListIterator interface
    13·1 answer
  • A(n) _____ is money paid for work.<br><br> A. raise <br> B. allowance<br> C. wage<br> D. grant
    14·2 answers
  • Amazon SWF is restricts you to use a specific programming language when setting up a work flow
    8·1 answer
  • FIGURE A-2—Use the information in this chart to answer Question 2.
    11·1 answer
  • In batch operating system three job J1 J2 and J3 are submitted for execution each job involes an I/O activity a CPU time and ano
    13·1 answer
  • Public class Main{ public static void main(String [] args){ String name=WelcomeJava; Runnable r1=() -&gt; System.out.println(nam
    12·1 answer
  • What do computer programs generally try to solve and how? A) Computer programs generally try to solve a well-defined problem usi
    14·1 answer
  • Hi<br>is it right?<br>"I think there is a small mistake in the quotation(second not first)"​
    5·1 answer
  • ....is an act of introducing an invention into market on business basis for profit​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!