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
an engineer is writing a web application that requires some user input. the engineer has put a submit button on their page and n
Setler [38]

In order to make the program recognize the clicking of a button, the engineer should add an event listener to the JavaScript code.

An event is considered to be a vital part of JavaScript because a web page responds according to the event that occurred. Some events are generated by APIs and some are user-generated events. For example, clicking or moving the mouse button and pressing a key on the keyboard are user generated events.

In order to handle the user-generated events in JavaScript,  an event listener is used. An event listener is a function or procedure in a JavaScript program that waits for an event to occur; such as pressing a key on the keyboard or clicking the button. Therefore based on the scenario given in the question statement, the engineer should use an event listener to his JavaScript code so that the code can recognize the click of the button.

You can learnmore about event at

brainly.com/question/20169706

#SPJ4

7 0
11 months ago
for java ?(Business: check ISBN-13)ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d1
ludmilkaskok [199]

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String isbn;

 System.out.print("First 1:2 digits: ");

 isbn = input.nextLine();

 if(isbn.length()==12){

 int chksum = 0;

 for(int i = 0; i<12;i++){

     if((i+1)%2==0){      chksum+= 3 * Character.getNumericValue(isbn.charAt(i));          }

     else{          chksum+=Character.getNumericValue(isbn.charAt(i));          }  }

 chksum%=10;

 chksum=10-chksum;

 if(chksum==10){

 System.out.print("The ISBN-13 number is "+isbn+"0");}

 else{

 System.out.print("The ISBN-13 number is "+isbn+""+chksum);          }   }

 else{

     System.out.print("Invalid Input");

 }     }}

Explanation:

See attachment for explanation where comments are used to explain each line

Download txt
6 0
3 years ago
In Python write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs
Lilit [14]

Answer:

ansList =input().split() #get input and split it by space

ansList = [int(i) for i in ansList if int(i)>0] #turn string to integer,and get all positive integers

print(ansList)

Explanation: I think this would work for you. I leace comments in the answer.

3 0
1 year ago
You are building a computer from spare parts in the office. You build the computer and realize you have several different types
san4es73 [151]

Answer:

The pin count is the same

Explanation:

5 0
3 years ago
You are testing a site and realize that when you click a graphic link you see an outline but no picture. What is wrong with the
deff fn [24]

Pictures not loading on websites Chrome – Many users reported that pictures aren't loading on websites in Chrome. To fix the problem, be sure to check your Chrome settings and disable your antivirus. Images won't load in Chrome – Sometimes this issue can appear if JavaScript is disabled in your browser.

Explanation:

Speaking of image problems, users reported the following issues:

  • Broken image icon Firefox, Internet Explorer – According to users, you might be able to experience this issue in other browsers including Firefox and Internet Explorer. If the problem appears in other browsers, the issue is related to your system or to your network configuration.
  • Pictures not loading on websites Chrome – Many users reported that pictures aren’t loading on websites in Chrome. To fix the problem, be sure to check your Chrome settings and disable your antivirus.
  • Images won’t load in Chrome – Sometimes this issue can appear if JavaScript is disabled in your browser. If that’s the case, simply enable JavaScript and the problem will be resolved.
  • Chrome showing broken images – In some cases, extensions can lead to this problem, and if you noticed that your images are missing, simply disable or uninstall your extensions and check if that solves the problem.
  • You can remove an image from the preview by clicking the thumbnail below Available images. Edit Descriptions: If you've added multiple images, click the description below each image in the preview to edit it.
  • Icon in the top-right corner of the window. Select Internet Options. In the Internet Options window, click the Advanced tab. In the Settings under Multimedia, make sure there is a check in the Show Pictures check box.
7 0
3 years ago
Other questions:
  • Calculate the total number of bits transferred if 200 pages of ASCII data are sent using asynchronous serial data transfer. Assu
    5·1 answer
  • A drivers touches a cars steering wheel on a hot day which term refers to the way heat is transferredd to the drivers hand
    6·2 answers
  • . The first step in devising security services and mechanisms is to develop a security policy True False
    11·1 answer
  • Describe the positive and negative effects of Internet​
    6·2 answers
  • Why do most laptops have LCD rather than OLED displays, which are found on mobile devices?
    14·1 answer
  • Indicate the time efficiency classes of the three main operations (i.e., FindMax, DeleteMax, and Insert) of the priority queue i
    11·1 answer
  • A global clothing company is looking to create a more immersive shopping experience for customers.What is a way the company can
    14·2 answers
  • File names should be limited to 144 characters.<br><br> true or false
    12·1 answer
  • Define management styles
    14·2 answers
  • _______________________ variables do not need to be declared inside the function definition body, they get declared when the fun
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!