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
Tamiku [17]
3 years ago
12

If a method writes to a file it should start out like (fill out the blank, what should you write after the parameters in the met

hod header?): accessor returnValue methodName ( parameters ) __________________
Computers and Technology
1 answer:
Ivan3 years ago
7 0

Answer:

accessor returnValue methodName ( parameters ) throws IOException;

Explanation:

If a method writes to a file then it may potentially encounter Input-Output related exception during the execution. In order to handle this scenario the function signature should include the throws clause. So the method signature should be as follows:

accessor returnValue methodName ( parameters ) throws IOException;

For example, if the method is called writeToFile , its signature can be of the form:

public void writeToFile(String data) throws IOException;

You might be interested in
Create an ArrayList of Employees (contain id and name) and add 3 Employees to the ArrayList to start. Next, you want to sort the
Anna [14]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't accept the symbol

Explanation:

Java code:

import java.util.*; public class Employees { // variables private int id; private String name; // getters public String getName() { return name; } public int getId() { return id; } // constructor public Employees(int id, String name) { this.id = id; this.name = name; } // comparator function based on the name static class compareByName implements Comparator<Employees> { "at"Override public int compare(Employees emp1, Employees emp2) { return emp1.getName().compareTo(emp2.getName()); } } // clone method for arraylist public static ArrayList<Employees> clone(ArrayList<Employees> arr) { ArrayList<Employees> temp = new ArrayList<Employees>(); for(int i=0;i<arr.size();i++) temp.add(arr.get(i)); return temp; } // main method public static void main(String[] args) { Scanner scan = new Scanner(System. in); // reading 3 employees details ArrayList<Employees> arr = new ArrayList<Employees>(); for(int i=0;i<3;i++) { System.out.print("Enter id: "); int id = scan. nextInt(); System.out.print("Enter name: "); scan. nextLine(); String name = scan. nextLine(); arr.add(new Employees(id,name)); } // cloning and sorting ArrayList<Employees> cloneArray = clone(arr); Collections. sort(arr, new compareByName()); // printing System. out. println("Array after cloning: "); for(int i=0;i<cloneArray. size();i++) { System.out.println(cloneArray. get(i). getId() + " " + cloneArray. get(i).getName()); } System. out. println("Array after sorting: "); for(int i=0;i<arr.size();i++) { System. out. println(arr.get(i). getId() + " " + arr.get(i). getName()); } } }  

Kindly check the attached images below for the code screenshot and code output.

3 0
3 years ago
I want to start a debate about something
vovangra [49]

Answer:

I agree for 13-yrs old not having driving licenses because they will become a lot of wrecks and they also can kill themselves or someone and I also agree that they should not be able to get jobs because if someone stills something or a robbery happens then they could get kidnapped or they could get shot

3 0
3 years ago
Read 2 more answers
What command do you use to set the suid bit on a script?
Debora [2.8K]
Unix/Linux question, cool.

<span>Typically we'd use chmod with +s in there.

chmod u+s script


</span>
5 0
3 years ago
Which two keys are commonly used to move or insert data?.
vlabodo [156]

Answer:

control and shift

Explanation:

6 0
3 years ago
The incandescent test lamp is used to check for the presence of A. AC current. B. DC voltage. C. DC current.
andriy [413]
Incandescent test lamps are used to check for Alternating Current Voltage and Direct Current Voltage. 

The answer is AC Voltage and DC Voltage. 
5 0
3 years ago
Read 2 more answers
Other questions:
  • Question 1 of 20 :
    15·2 answers
  • Computers heat resistant materials breathing systems for fire fighters food-growing technologies improvements in all of the item
    14·1 answer
  • Supply is a powerful force in a free market.
    9·2 answers
  • Materials such as copper, silver, and aluminum through which electric energy passes freely are called
    13·1 answer
  • Autonomous learners have a vast array of learning strategies in their toolboxes to choose from, most of which are effective in a
    15·1 answer
  • Why is it important to ensure that your software is up to date?
    13·1 answer
  • How has the internet improved business communication worldwide
    11·1 answer
  • Watch any film of the silent era. Choose a short film from any genre that is less than 30 minutes long. Write a review of your e
    12·1 answer
  • What version of bluetooth is installed on the yaesu ft-5dr?.
    8·1 answer
  • A technician is troubleshooting a Windows computer and needs to stop the explorer.exe process.Multiple attempts to open Task Man
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!