1. Given the following program: 1 public class tripleInteger { 2 30 public static void main(String[] args) { 4 int numOne = 100; 7 System.out.print("Your integer is " + numOne + "\n"); 8 9....


The output of the program is:


Your integer is 100


Your integer is 300


Your integer is 100



QUESTION


b) Explain why the value of numOne is still 100 at line 11 after passing it to method tripleInt() at line 9


c) Which syntax(s) need to modify for the value of numOne to be 300 after passing it to method tripleInt() at line 9? [Identify the line code and write the correct syntax(s)]


1. Given the following program:<br>1 public class tripleInteger {<br>2<br>30<br>public static void main(String[] args) {<br>4<br>int numOne = 100;<br>7<br>System.out.print(

Extracted text: 1. Given the following program: 1 public class tripleInteger { 2 30 public static void main(String[] args) { 4 int numOne = 100; 7 System.out.print("Your integer is " + numOne + "\n"); 8 9. tripleInt(numOne); 10 System.out.print("Your integer is " + numOne + "\n"); } 11 12 13 public static void tripleInt (int numone) { numOne = numOne * 3; System.out.print("Your integer is " + numOne + "\n"); } 140 15 16 17 18 19 } Figure 3: Program 6.3
b) Explain why the value of numOne is still 100 at line 11 after passing it to method<br>tripleInt() at line 9?<br>c)<br>it to method tripleInt() at line 9? [Identify the line code and write the correct<br>syntax(s)]<br>Which syntax(s) need to modify for the value of numOne to be 300 after passing<br>

Extracted text: b) Explain why the value of numOne is still 100 at line 11 after passing it to method tripleInt() at line 9? c) it to method tripleInt() at line 9? [Identify the line code and write the correct syntax(s)] Which syntax(s) need to modify for the value of numOne to be 300 after passing

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here