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
balu736 [363]
3 years ago
12

Given the function definition

Computers and Technology
1 answer:
kirza4 [7]3 years ago
4 0

output of the following code fragment that invokes Twist is:

1 14 3

Explanation:

In the function Twist(),two parameters are passed. First is passed by value and second is passed by reference. If a variable is passed by value then any change made by the function will not affect the original value of that variable but when a variable is passed by reference then any change made by the function will change the original value of that variable. When Twist() function invokes with a=3 and b=2 then value of c=3+2 i.e c=5, a=3*3 i.e. a=9 (value of "a" was 3 earlier) and and b=c+a i.e b=5+9. Here only "b"is passed by reference for variable "s" then any change in it's value will be reflected in the "s". That will update the value of "s" to 14.

You might be interested in
For an alternative to the String class, and so that you can change a String's contents, you can use_________ .
mr_godi [17]

Answer:

c. StringBuilder

Explanation:

An alternative to the String class would be the StringBuilder Class. This class uses Strings as objects and allows you to mix and match different strings as well as adding, removing, implementing,  and modifying strings themselves as though they were similar to an array. Unlike the string class StringBuilder allows you to modify and work with a combination of strings in the same piece of data as opposed to having various objects and copying pieces which would take up more memory.

7 0
4 years ago
Write a function solution that returns an arbitrary integer which is greater than n.
Aleksandr-060686 [28]

Answer:

   public static int greaterThanInt(int n){

       return n+10;

   }

Explanation:

This is a very simple method in Java. it will accept an argument which is an integer n and return n+10 since the question requires that an arbitrary integer greater than n be returned adding any int value to n will make it greater than n.

A complete java program calling the method is given below:

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Please enter an integer");</em>

<em>        int n = in.nextInt();</em>

<em>        int greaterInt = greaterThanInt(n);</em>

<em>        System.out.println("You entered "+n+", "+greaterInt+" is larger than it");</em>

<em>    }</em>

<em>    public static int greaterThanInt(int n){</em>

<em>        return n+10;</em>

<em>    }</em>

<em>}</em>

4 0
4 years ago
Add the following methods to the ArrayCollection class, and create a test driver for each to show that they work correctly. In o
maks197457 [2]

Answer:

Attached are screenshots of the working code - baring in mind this only works on mutable Collection types. (ones that can be changed) if you use Collections that don't support this you may experience an Unsupported Operation Exception - but this is expected.

Explanation:

Using Java streams as an alternative for some answers.

3 0
3 years ago
What does a file extension tell you?
kiruha [24]

A. because everyone basically has seen it..

3 0
3 years ago
What is a Database, Flat file and Relational Database?
Marta_Voda [28]

Answer:

A flat file database stores data in a single table structure. A relational database uses multiple table structures, cross-referencing records between tables. Tables in both organize records in rows, with each column containing a single piece of data in the record.

8 0
2 years ago
Other questions:
  • An engineer is assigned the task of reducing the air pollutants being released from a power plant that generates electricity by
    9·1 answer
  • The opening of the throttle plate can be delayed as long as
    13·1 answer
  • Given the list my_list containing integers, create a list consisting of all the even elements of my_list. Associate the new list
    12·1 answer
  • Why would it be beneficial to preview a page before printing?
    8·1 answer
  • What is the group scope for domain admins, domain controllers, and domain users default groups?
    9·1 answer
  • When using the Simple Query Wizard, Kirsten wanted to transfer all of her available data to a new table. She should click
    14·1 answer
  • How have productivity programs improved the professional lives of people? (check all that apply)
    8·2 answers
  • What were second generation languages that required detailed knowledge of the computer's hardware and a lot of spare time to wri
    11·1 answer
  • Create the arrays and assign randomized values for each element in the array. The randomized values should range from 1 to twice
    9·1 answer
  • Which memory will be suitable (a) to Run a software (b) to store a software permanently ?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!