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
anygoal [31]
3 years ago
11

What occurs when you call a method on a reference variable that contains null? Select one: a. An ArrayIndexOutOfBoundsException

error b. An ArithmeticException error c. A NullPointerException error d. A ClassCastException error
Computers and Technology
1 answer:
Finger [1]3 years ago
5 0

Answer:

Option(c) i.e "A NullPointerException error " is the correct answer for the given question.

Explanation:

Exception are the run time error in the program.A NullPointerException is the runtime error when the pointer containing the NULL value .This type of exception occur when we call that function on the pointer variable which contains the NULL.

  • ArrayIndexOutOfBoundsException error occur when we accessing the element which is out of the index or bound so this option is incorrect.
  • An ArithmeticException error  occur in the arithmetic operation. Suppose a number is divided by zero then the ArithmeticException error is occured .
  • ClassCastException error occur in the typecasting of a specific object.So this option is incorrect.
You might be interested in
Given the char * variables name1, name2, and name3, write a fragment of code that assigns the largest value to the variable max
Assoli18 [71]

Answer:

The following code as follows:

Code:

max=name1;   //define variable max that holds name1 variable value.

if (strcmp(name2, max)>0)  //if block.

{

   max=name2;  //assign value to max.

}

if (strcmp(name3,max)>0)   //if block.

{

  max=name3; //assign value to max.

}

Explanation:

In the above code, we define a variable that is max. The data type of max variable is the same as variables "name1, name2, and name3" that is "char". In the max variable, we assign the value of the name1 variable and use if block statement two times. In if block, we use strcmp() function that can be defined as:

  • In first if block we pass two variables in strcmp() function that is "name2 and max" that compare string value. If the name2 variable is greater then max variable value so, the max variable value is change by name2 variable that is "max=name2".
  • In second if block we pass two variables in strcmp() function that is "name3 and max" that compare string value. If the name3 variable is greater then max variable value so, the max variable value is change by name3 variable that is "max=name3".

4 0
3 years ago
1,2,3,4,5,6,7,8,9,10 – Best case - Sorted in ascending order
Pepsi [2]

Using the knowledge in computational language in python it is possible to write a code that from a random number draw creates an order of increasing numbers

<h3>Writting the code in python:</h3>

<em>def shellSort(array, n):</em>

<em>    # Rearrange elements at each n/2, n/4, n/8, ... intervals</em>

<em>    interval = n // 2</em>

<em>    while interval > 0:</em>

<em>        for i in range(interval, n):</em>

<em>            temp = array[i]</em>

<em>            j = i</em>

<em>            while j >= interval and array[j - interval] > temp:</em>

<em>                array[j] = array[j - interval]</em>

<em>                j -= interval</em>

<em>            array[j] = temp</em>

<em>        interval //= 2</em>

<em>data = [10,9,8,7,6,5,4,3,2,1]</em>

<em>size = len(data)</em>

<em>shellSort(data, size)</em>

<em>print('Sorted Array in Ascending Order:')</em>

<em>print(data)</em>

See more about python at brainly.com/question/18502436

#SPJ1

5 0
2 years ago
A document that promises to pay specified sums of money on specified dates and is a debt to the issuer is called
MissTica
<span>A document that promises to pay specified sums of money on specified dates and is a debt to the issuer is called a bond</span>
6 0
3 years ago
Part B How could installing new technology, such as scrubber machines, affect the factories required to install them? Name a pos
Verdich [7]

Answer:It will decrease harmful emissions, so the factories will no longer need to install them.

Explanation:

This helps improve the safety of the surrounding community and workers. But this technology is expensive and required time and effort to install.

5 0
1 year ago
1. How many column can you insert in a MS Word in maximum?
tigry1 [53]

Answer:

63 columns

Explanation:

In Microsoft Word you can insert a table with up to 63 columns, that is the limit to the number of columns allowed in a Word document.

<em>brainliest</em><em>? </em><em>plz! </em>

3 0
3 years ago
Other questions:
  • Why would you want to minimize the Ribbon?
    11·1 answer
  • Write a program that prints the block letter “B” in a 7x7 grid of stars like this:
    13·1 answer
  • Interactive sites where users write personal topics and comments to a threadded discussion are called?
    11·1 answer
  • . Write a short program that asks the user to input a string, and then outputs the
    15·1 answer
  • The most widely used presentation software program is Microsoft PowerPoint. You can produce a professional and memorable present
    8·1 answer
  • What is the definition of posture<br>​
    7·1 answer
  • Mrs. Zoo gave out the rubric for our essay. She stated that our essay should be complete by Friday of that week. I didn't have t
    13·1 answer
  • When an external device becomes ready to be serviced by the processor the device sends a(n)_________ signal to the processor.
    8·1 answer
  • What does it mean to prioritize tasks?
    12·2 answers
  • Firestick optimizing system storage and applications loop
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!