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
Bad White [126]
3 years ago
11

What will be the output of the following code?

Computers and Technology
1 answer:
saveliy_v [14]3 years ago
5 0

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is : 4.

When you run this program in Java. The output produce by this program is 4

The given code is:

import java.util.ArrayList;

public class arrayList7

{

public static void main(String[] args) {

ArrayList one = new ArrayList ();

Integer count=3;

count=count+1;

one.add(2);

one.add(count);

System.out.println(one.get(1));

}

}

This code store the value in ArrayList one variable. It first adds 2 at zero indexes and 4 at first index.  When you print the value at index one, you will get the output 4. because the count variable contains 4. If you want to print 2, then you specify the print statement that prints the value at index zero. eg.

System.out.println(one.get(0));

You might be interested in
According to Google data, among consumers who conduct a local search on their smartphone, how many then visit a store within a d
sertanlavr [38]

Answer:

According to the google data, 50% consumers visited a store when they conduct a local search on their smartphones within a day.

And consumers more than 60% range uses location data in the advertisements. They uses store location and phone number through the advisement on smartphones and laptop.  

More than 34% of consumers search on the laptops and computer are visited to a store within a day.

8 0
3 years ago
Write a complete program that asks the user to input the height and radius of a cone (both of type double) and calls two individ
Vika [28.1K]

Answer:

The program in C++ is as follows:

#include <iostream>

#include <math.h>

using namespace std;

double area(double r, double h){

   double A = 3.14 * r * (r + sqrt(h*h + r*r));

   return A;}

double volume(double r, double h){

   double V = (1.0/3) * 3.14 * r*r * h;

   return V;}

int main(){

   double radius, height;

   cout<<"Radius: "; cin>>radius;

   cout<<"Height: "; cin>>height;

   cout<<"Area: "<<area(radius,height)<<endl;

   cout<<"Volume: "<<volume(radius,height);

   return 0;

}

Explanation:

This declares the area function

double area(double r, double h){

Calculate area

   double A = 3.14 * r * (r + sqrt(h*h + r*r));

Return the calculated area

   return A;}

This declares the volume method

double volume(double r, double h){

Calculate volume

   double V = (1.0/3) * 3.14 * r*r * h;

Return the calculated volume

   return V;}

The main begins here

int main(){

Declare radius and height

   double radius, height;

Get input for radius

   cout<<"Radius: "; cin>>radius;

Get input for height

   cout<<"Height: "; cin>>height;

Call the area function and print the returned value for area

   cout<<"Area: "<<area(radius,height)<<endl;

Call the volume function and print the returned value for volume

   cout<<"Volume: "<<volume(radius,height);

   return 0;

}

4 0
3 years ago
Lamp is an acronym for a complete solution of open source software that goes together to build a general purpose web server. whi
Westkost [7]
Answer choices?

LAMP contains <span>Linux, Apache, MySQL, and PHP.</span>
3 0
3 years ago
Jazmine just finished setting up an operating system that's designed to work between a VM guest OS and computer hardware. What i
VikaD [51]

The name of the operating system Jazmine is setting up is option A: Client  operating system.

<h3>What  is the operating system running in virtual machines?</h3>

A guest or client operating system is known to be the operating system that one can installed on a virtual machine (VM) or on any kind of partitioned disk.

Hence, the name of the operating system Jazmine is setting up is option A: Client  operating system.

Learn more about operating system from

brainly.com/question/22811693

#SPJ1

3 0
2 years ago
CS124 PRATCTICE
Levart [38]

Answer:

b

Explanation:

6 0
3 years ago
Other questions:
  • A computer ____ is the amount of data (measured in bits or bytes) that a cpu can manipulate at one time
    8·1 answer
  • Why do local variables lose their values between calls to the function in which they are
    5·1 answer
  • A junior network administrator has used the wrong cable type to connect his/her computer to the administrative port on a router
    7·1 answer
  • How is DATA sent across a Network?
    7·1 answer
  • Write a Python program that asks the user for a positive, odd value. Once the value is validated determine if the number is Prim
    11·1 answer
  • A collection of computers, printers, routers, switches, and other devices
    15·1 answer
  • 4.2 Code Practice: Question 2​
    14·1 answer
  • Tipos de lenguajes relacionados con c++?
    7·1 answer
  • What is the difference between MAC address and IP address?<br> Thanks in advance
    6·1 answer
  • ¿Qué tipo de información deben proteger los sitios de comercio electrónico?​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!