Predict the output of the following program? import java.io.*; public class Test { public static void...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Predict the output of the following program? import java.io.*; public class Test { public static void main(String[] args) throws IOException { try ( } FileOutputStream foutstrm=new FileOutputStream("C:\\testout.txt"); DataOutputStream output = new DataOutputStream(foutstrm); output.writeUTF("John Smith"); output.writelnt(85); try ( } } FileInputStream finput-new FileInputStream("C:\\testout.txt"); DataInputStream Input = new DataInputStream(finput); System.out.println(input.readUTF()+*+ Input.readInt(); Predict the output of the following program? import java.io.*; public class Test { public static void main(String[] args) throws IOException { try ( } FileOutputStream foutstrm=new FileOutputStream("C:\\testout.txt"); DataOutputStream output = new DataOutputStream(foutstrm); output.writeUTF("John Smith"); output.writelnt(85); try ( } } FileInputStream finput-new FileInputStream("C:\\testout.txt"); DataInputStream Input = new DataInputStream(finput); System.out.println(input.readUTF()+*+ Input.readInt();
Expert Answer:
Answer rating: 100% (QA)
There are several syntax errors in the given code snippet Heres the corr... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Project Goals In this project, you will be developing a simple Java application (texttool) using an agile, test-driven process involving multiple deliverables. While you will receive one grade for...
-
Apply Theorem 3 to calculate the matrix exponential e At for each of the matrices in Problems 35 through 40. A = 13 3 3 3 01 3 3 00 23 0002
-
Cutler Corporation is authorized to issue 10,000 shares of common stock. It sells 6,000 shares at $19 per share. Required Record the sale of the common stock, given the following independent...
-
Using the original cost of capital data for Ganado used in the chapter, calculate both the CAPM and ICAPM costs of capital for the following equity risk premium estimates. a. 8.00% b. 7.00% c. 5.00%...
-
A U.S. Treasury bond pays a 7% coupon on January 7 and July 7. How much interest accrues per \($100\) of principal to the bond holder between July 7, 2013, and August 9, 2013? How would your answer...
-
Runcke Motor Company manufactures automobiles. During September 2011 the company purchased 5,000 head lamps at a cost of $9 per lamp. Runcke withdrew 4,650 lamps from the warehouse during the month....
-
Two blocks are fastened to the ceiling of an elevator as in Figure. The elevator accelerates upward at 2.00 m/s. Find the tension in each rope. T 10.0 kg T 10.0 kg
-
Suppose there are three types of individuals: high productivity (HP), medium productivity (MP) and low productivity (LP). LP and MP workers amount for a proportion of sizes qL and qM of the entire...
-
- Calculate the break-even price. What would the selling price have to be to get the target return? What other factors besides break-even should you consider before setting price?
-
"Text editors are great at helping you write code. They can do syntax highlighting and make sure that you have a closing curly bracket, }, for each opening curly bracket {." Develop and implement a...
-
How to response this message: "One example of a need for more inclusion and recognition of the transgender community. This particular group of people would benefit from affirmative action is...
-
What is the Three-Dimensional Model of Leadership Effectiveness adapted from William Reddin's managerial effectiveness? Explain.
-
Calculate the straight-line and sum-of-years-digits depreciation schedules for a $1,000 computer purchased by a college athletic department with a useful life of five years and no salvage value.
-
Daisy Farm, a NSW based dairy company exports fresh milk to China. Chinese Yuan (CNY) has been trading at AUD/CNY5.00. Exports to China are currently 100,000 litres per year at the equivalent price...
-
A spring block system is placed on a horizontal rough surface as shown in the figure. The block is given velocity when the spring is in natural length. The total distance travelled by the block...
-
DC has unused FTC carryover from 2017 in the separate category for GC income as the result of income generated by a foreign branch. The income was foreign source general category income. In 2018 the...
-
Suppose we want to compute the amount of money in a bank account with compound interest. If the amount of money in the account is m, the amount in the account at the end of the month will be 1.005m....
-
Create an application that will keep track of several groups of strings. Each string will be a member of exactly one group. We would like to be able to see whether two strings are in the same group...
-
Do Programming Project 9 from Chapter 8 using lambda functions to implement the button click events. Programming Project 9 Create a JavaFX application that acts as a simple calculator. Create buttons...
-
Sumitomo Cable manufactures various types of aluminum and copper cables which it sells directly to retail outlets through its distribution channels. The manufacturing process for producing cables...
-
The Cooper Furniture Company of Potomac, Maryland, assembles two types of chairs (Recliners and Rockers). Separate assembly lines are used for each type of chair. Classify each cost item (AI) as...
-
The following data are for Marvin Department Store. The account balances (in thousands) are for 2017. 1. Compute (a) the cost of goods purchased and (b) the cost of goods sold. 2. Prepare the income...
Study smarter with the SolutionInn App