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)]

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

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:
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
Transcribed Image 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
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
Transcribed Image 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT