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
Which of the following activities would be best-suited for a thinking mind map?
Ivahew [28]

Answer:

Use Mind Maps For Idea Generation

Use Mind Maps to Better Retain Information From Books and Articles

Use Mind Maps For Problem Solving

Use Mind Maps to Take Notes During Meetings

Use Mind Maps to Set Life Goals

Use Mind Maps for Project Management

Use Mind Maps to Write Your Novel

Use Mind Maps to Write Ebooks.

Use Mind Maps to Write a Business Plan

Use a Mind Map to Write Your Memoir

Use A Mind Map to Plan Your Finances

Use Mind Maps for Your To-Do List

Use Mind Maps for Holiday Planning

Use Mind Maps for Yearly Planning

Explanation: This isn't a direct answer, sorry but I put all the ways its best used for

3 0
3 years ago
Read 2 more answers
Write a C++ program that reads from the standard input and counts the number of times each word is seen. A word is a number of n
Rufina [12.5K]

Answer:

#include <stdio.h>

#include <string.h>

#include <ctype.h>

 

struct detail

{

   char word[20];

   int freq;

};

 

int update(struct detail [], const char [], int);

 

int main()

{

   struct detail s[10];

   char string[100], unit[20], c;

   int i = 0, freq = 0, j = 0, count = 0, num = 0;

 

   for (i = 0; i < 10; i++)

   {

      s[i].freq = 0;

   }

   printf("Enter string: ");

   i = 0;

   do

   {

       fflush(stdin);

       c = getchar();

       string[i++] = c;

 

   } while (c != '\n');

   string[i - 1] = '\0';

   printf("The string entered is: %s\n", string);

   for (i = 0; i < strlen(string); i++)

   {

       while (i < strlen(string) && string[i] != ' ' && isalnum(string[i]))

       {

           unit[j++] = string[i++];

       }

       if (j != 0)

       {

           unit[j] = '\0';

           count = update(s, unit, count);

           j = 0;

       }

   }

 

   printf("*****************\nWord\tFrequency\n*****************\n");

   for (i = 0; i < count; i++)

   {

       printf("%s\t   %d\n", s[i].word, s[i].freq);

       if (s[i].freq > 1)

       {

           num++;

       }

   }

   printf("The number of repeated words are %d.\n", num);

 

   return 0;

}

 

int update(struct detail s[], const char unit[], int count)

{

   int i;

 

   for (i = 0; i < count; i++)

   {

       if (strcmp(s[i].word, unit) == 0)

       {

           s[i].freq++;

 

           return count;

       }

   }

   /*If control reaches here, it means no match found in struct*/

   strcpy(s[count].word, unit);

   s[count].freq++;

 

   /*count represents the number of fields updated in array s*/

   return (count + 1);

}

4 0
3 years ago
Look at the following description of a problem domain:The bank offers the following types of accounts to its customers: saving a
Alchen [17]

Answer:

The answers are explained below

Explanation:

1) Identify the potential classes in this problem domain be list all the nouns

class Customer

class Acco  unt

2) Refine the list to include only the necessary class names for this problem

the class customer is not necessary to solve the problem itself, therefore the only class could be the account class

3) Identify the responsibilities of the class or classes.

The responsibilities of the class account will be

* determination of the type of account--> Acc  ount . type(char)

*  deposit money into the account --> Acc  ount . de posit(float)

* withdraw money into the account --> Acc  ount . with draw(float)

* show balance of the account --> Acc  ount . bal ance()

* generate interest --> Acc  ount . int erest()

Please join the words together. I used spaces due to regulations

5 0
4 years ago
Why is it important to prepare the farm resources before you start working? explain​
motikmotik
The planning process helps to: Identify the goals of the farm business (what you want to accomplish); Identify the farm's inventory and resources (what you have to work with); Assess the farm business and the environment in which it operates (where you are and where you may want to go);

6 0
3 years ago
Derek, a project manager. is involved in an activity that occurs during the system-level requirements analysis. In which activit
Vilka [71]

Derek is involved in the option C.) work breakdown structure activity of providing insights about the design.

<h3>What is work breakdown structure?</h3>

A Work Breakdown Structure (WBS) is known to be a kind of an hierarchical outline  or division of the tasks that is known to be needed to complete a  given project.

Note that the WBS “breaks down” is seen as the structuring of any given  project into a way that is said to be manageable in its deliverables.

Note also that the deliverable is sent on a task and as such, Derek is involved in the option C.) work breakdown structure activity of providing insights about the design.

Learn more about work breakdown structure from

brainly.com/question/6197566
#SPJ1

Derek, a project manager, needs to create a plan for a software development project. Which approach or document will help him define the tasks required to carry out that project?

A.) tracking application

B.) tracksheet

C.) work breakdown structure

D.) project application

8 0
2 years ago
Other questions:
  • What are Three types of informational references
    9·2 answers
  • When you reach a YIELD sign, yield to cross traffic and ____ before you enter the intersection.
    14·2 answers
  • What is the first document that colleges review when making admissions decisions
    10·2 answers
  • Caitlyn's Crafty Creations computes a retail price for each product as the cost of materials plus $14 multiplied by the number o
    10·1 answer
  • A technician has just finished installing a secondary OS on a workstation. After rebooting the computer, the technician receives
    13·1 answer
  • What are the four elements of game design?<br><br> Help Me!!
    9·1 answer
  • Verify (valid or not valid) using resolution the following reasoning: "Every student in the SCIS is a CS student or an IT studen
    15·1 answer
  • What was Pike's objective on his first expedition in 1805?​
    9·1 answer
  • What are the pros and cons of stone, wood, brick, concrete, steel, and glass for architecture building materials?
    7·2 answers
  • Every Java statement ends with: *<br><br> Period<br> Colon<br> Double quote<br> Semicolon
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!