What is the output of the following program? public class NewClass { public static int ages[]...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
What is the output of the following program? public class NewClass { public static int ages[] = { 6, 21, 9 }; public static void main(String[] args) { Employee person = new Employee(); ages [0] = 12; transform (person, ages); person = new Employee(); ages [0] = 3; } H + person. numbers [0]); +ages [1] + " + ages [2]); H System.out.println (person.name + System.out.println(ages [0] + # public static int transform (Employee p, int[] ages) { ages [1] = 13; } p. name = "Bob"; p. numbers [0] = ages [0]; P= new Employee(); ages [2] = 14; return ages [2]; } class Employee { public String name = "Bill"; public int [] numbers = { 10, 20, 30, 40 }; What is the output of the following program? public class NewClass { public static int ages[] = { 6, 21, 9 }; public static void main(String[] args) { Employee person = new Employee(); ages [0] = 12; transform (person, ages); person = new Employee(); ages [0] = 3; } H + person. numbers [0]); +ages [1] + " + ages [2]); H System.out.println (person.name + System.out.println(ages [0] + # public static int transform (Employee p, int[] ages) { ages [1] = 13; } p. name = "Bob"; p. numbers [0] = ages [0]; P= new Employee(); ages [2] = 14; return ages [2]; } class Employee { public String name = "Bill"; public int [] numbers = { 10, 20, 30, 40 };
Expert Answer:
Answer rating: 100% (QA)
Based on the given code snippets from the images lets walk through the program step by step to deter... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these programming questions
-
find the limit 49. lim *0 sin x - sin x cos x +2
-
As business office manager of Group HMO, Inc., Dana Smith was responsible for the work of approximately 45 employees, of whom 26 were classified as secretarial or clerical. At the direction of the...
-
What is the output of this code? Explain how did you made the file and provide a pic of the out put. import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class...
-
Assume you have just been hired as a business manager of PizzaPalace, a regional pizza restaurant chain. The companys EBIT was $120 million last year and is not expected to grow. PizzaPalace is in...
-
In 2013, Homer and his wife, Wilma (residents of a non-community property state) make the gifts listed below. Homer's previous taxable gifts consist of $100,000 made in 1975 and $1.4 million made in...
-
The percentage of the worlds population living in developed countries decreased from 27.1% in 1970 to 16.4% now. Percentages of Percentages. Exercises describe changes in which the measurements...
-
The adjusted trial balance of Lighthouse Realty, Inc., at December 31,2010, follows: Requirements 1. Prepare Lighthouse Realtys 2010 income statement, statement of retained earnings, and year-end...
-
A vertical column of A36 structural steel (Sy = 36 kpsi, Sut = 5880 kpsi) is 10 in wide. An attachment has been designed to the point shown in the figure. The static load of 20 kip is applied, and...
-
For the indicated units produced, Katherin Plc Ltd. reported the costs shown below: Units produced: Total direct material: Total direct labor: 9,500 4,600 $95,950 $46,460 $118,750 $57,500 Total...
-
You are called by the daughter of an elderly woman who lives alone. The daughter lives in another city and is concerned because her mother does not drive and has seemed unhappy and listless on the...
-
A loop should output 1 to n. If n is 5, the output is 12345. What should XXX and YYY be? Choices are in the form XXX/YYY. n = scnr. nextint (); for (XXX; i++) { System.out. println (YYY); } A ( i =...
-
How do specific genotypes confer differential susceptibility or resistance to environmental stressors, and what are the evolutionary consequences of such genotype-dependent selection pressures ?
-
When we speak about project financing, which is the purspose of the Liquidity ratios? What do they determine and which are the main ones which should be considered?
-
Write about Working Capital Turnovers Ratio terms of Mirvac group $0.12 million, Boral ltd $4.54 million and lendlease corporation ltd $3413 million. go indepth about each number and how it will...
-
cost of debt using financial calculator: $1 billion in outstanding debt (face value) Current quote = 110 Coupon rate = 9%, semiannual coupons 15 years to maturity Tax rate = 40%
-
Hayley invested $11,500.00 into an account paying a ridiculous 8% compounded quarterly. How much money will be in the account after 60 months? Round your final answer to the nearest cent.
-
What is the culture and society of the Philippines?
-
On March 31, 2018, Gardner Corporation received authorization to issue $30,000 of 9 percent, 30-year bonds payable. The bonds pay interest on March 31 and September 30. The entire issue was dated...
-
Write a complete Java program called Meta whose output is the text that would be the source code of a Java program that prints Hello, world! as its output.
-
Write nested for loops to produce the following output: * ** *** **** *****
-
The following piece of code incorrectly attempts to remove all even values from a stack of integers. What is wrong with the code, and how would you fix it? while (!s.isEmpty ()) { int n = s.pop ();...
-
Discuss the approach you would take to building a system for playing Scrabble or another word game of the sort. What limitations does your system have? How likely do you think it is that your system...
-
Discuss the current state of the art of game-playing computer systems in relation to the following games: chess, checkers, Go, bridge, Othello, tic-tac-toe. What advances are likely in the near...
-
Show the steps that would be taken in running the Minimax algorithm on the game tree in Figure 6.7. Now run through the same tree using alpha-beta pruning. How do the two compare? data from figure...
Study smarter with the SolutionInn App