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
Rina8888 [55]
4 years ago
10

NullPointerException and ArithmeticException are both derived from which class?

Computers and Technology
1 answer:
irina1246 [14]4 years ago
3 0

Answer: c) Run-time Exception

Explanation: Runtime Exception is the exception that works in the JVM(Java Virtual Machine) as a super-class. It can also act during the general working of the JVM and are not checked by any resources. The exception that are followed from the Runtime exception is Arithmetic exception and  Null pointer exception as the subclass. Therefore ,the correct option is option(c).

You might be interested in
How people select, interpret, remember, and use information to make judgments and decisions is called __________.
Svetradugi [14.3K]

Answer: Social Cognition

Explanation: hope this helps

6 0
4 years ago
What is the full form of ALU​
Alexandra [31]

Answer: arithmetic logic unit: the part of a central processing unit that performs arithmetic and logical operations.

Srry if it is wrong

I hope it  helps you

6 0
3 years ago
Read 2 more answers
The following code does not work as intended. It is meant to input two test grades and return the average in decimal format:
vredina [299]

Answer:

Type casting error

Explanation:

Logically, the program is correct and it is expected to return the average value. However, test1 and test2 are int values and when you applies any algebraic expression on Int, it will result into Int.

So, in this part (test1 + test2 )/2, two integers are adding and the final result is still an integer and this part will act as an integer even if you multiple or divide with any external number.

For example,

test1 = 4

test2 = 5

test1 + test2 = 9

Now, if you divide it by 2, it will still react as an integer portion. So, 9/2 would result in 4 instead of 4.5. All the calculation is done on the right side before assigning it to a double variable. Therefore, the double variable is still getting the int value and your program is not working correctly.

The solution is to typecast the "(test1 + test2 )/2" portion to double using Double.valueOf(test1 + test2)/2 ;

I have also attached the working code below.

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 System.out.println("Hello World");

 Scanner scan = new Scanner (System.in);

 int test1 = scan.nextInt();

       int test2 = scan.nextInt();

       double average = Double.valueOf(test1 + test2)/2 ;

       System.out.println("Answer: " + average);

}

}

4 0
4 years ago
How to create a function, called separate_int_and_str, which takes in a list and separates out the integer values and strings in
gregori [183]

Answer:

program :

def separate_int_and_str(list_1):# function to seprate the list.

   str_list=[] #list to hold the

   int_list=[]#list which holds the integer value.

   for x in list_1: #for loop to extract the list.

       if(type(x)==str): #if condition to check the type of the element.

           str_list.append(x)#create a list for the string value.

       elif(type(x)==int): #check condition for th einteger value.

           int_list.append(x)#create a list for the integer value.

Explanation:

  • The above-defined function is written in the python language, which used the code to separate the list for integer and the string value.
  • There are two lists define in the function which holds the integer and the string value separately.
  • There is a 'for' loop which scans the element of the list and checks the list by the help of type function which tells the class of the element.
  • Then if the type function states that the element is from the strong class, it will assign the element on the string list otherwise it assigns the element in the integer list.
4 0
3 years ago
The part of the computer that performs the calculations that enable the computer to function and is sometimes referred to as the
VMariaS [17]
CPU, the central processing unit, can take and understand instructions and output a result according to its instructions. A core component of a CPU is the APU, an arithmetic processing unit, this is responsible for all mathematical calculations and comparisons.    <span />
6 0
3 years ago
Read 2 more answers
Other questions:
  • In what stage of writing does publishing occur
    14·1 answer
  • Anderson uses his computer and internet link to chart the movement of his favorite 46 stocks. He buys and sells according to the
    15·1 answer
  • Suppose that a computer virus infects your computer and corrupts the files you were going to submit for your current homework as
    12·1 answer
  • What can be entered in a search box to find data? data size a name relevance purpose
    5·2 answers
  • How does form get its power natural gas
    14·1 answer
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • Gini is a manager at a website design firm. She has a timeline prepared for the product to be delivered to the client. She needs
    6·2 answers
  • An internet connection is required to access which type of software?
    5·1 answer
  • An example of software is a _____.<br><br> spreadsheet<br> mouse<br> track ball<br> printer
    10·1 answer
  • NO LINKS Please
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!