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
Marianna [84]
3 years ago
5

What is displayed on the console when running the following program?

Computers and Technology
1 answer:
Andre45 [30]3 years ago
6 0

Answer:

The answer is "Option A"

Explanation:

In the given java code, a class "Test" is defined, inside the main method try and catch block is used, inside the try block method "p()" is called, that print a message. in this block two catch block is used, that works on "NumberFormatException" and "RuntimeException".  In the method "p" declaration, a string variable "s" is defined, that holds double value, that is "5.6", and converts its value into the wrong integer, and other wrong option can be described as follows:

  • In option B, it is wrong, it is not followed by after call method.
  • In option C, It is not followed by runtime exception, that's why it is incorrect.
  • Option D and Option E both were wrong because they can't give run time and compile-time error.  
You might be interested in
Identify the false statement.
Lelechka [254]
A is   false.
the   second  operand is not always  evaluated
if  the first operand is true  in the OR (||) then the second is not evaluated
if the  first operand in an  AND  (&&)  is false then the second is not evaluated
that  is called short circuit evaluation.
c is   also false   the expressions do not have to be boolean   any numeric  value is also  allowed.    It just to be zero or non zero

5 0
4 years ago
Identify possible advantages and disadvantages of using automatic withdrawal to pay bills
Aleonysh [2.5K]

advantages. discounts, builds credit, helps keep track on when you need to pay.

disadvantages. could overcharge if it doesn't have enough, could ruin credit, could jeopardize future loans

5 0
3 years ago
Read 2 more answers
Write a program that reads in ten numbers and displays the number of distinct numbers and the distinct numbers separated by exac
ELEN [110]

Answer:

The program to this question can be given as:

Program:

//import package.

import java.util.*;

public class Main //defining the class

{

public static void main(String[] args) //defining main method  

{

 Scanner ob = new Scanner(System.in); //creating scanner class object.

 int[] a = new int[10];//define array.  

 int number,counts= 0,i;//define variable.

 System.out.print("Enter numbers: "); //message.

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

 {

  number=ob.nextInt();

  if (isDistinct(a,number))

  {

      a[counts] = number;//assign value in array

      counts++; // Increment count

  }

 }

 System.out.println("The distinct numbers is :" + counts);

 System.out.print("The distinct number are :");

 for (i = 0; i <a.length; i++)//loop

 {

  if (a[i] > 0)

  {

   System.out.print(" " +a[i]);//print array.    

  }

   

 }

 System.out.println();

}

public static boolean isDistinct(int[] array, int num)//defining method  

{

 for (int i = 0; i < array.length; i++)//loop for check number  

 {

  if (num == array[i]) //check condition

  {

      return false; //return value false.

  }

 }

 return true; //return value true

}

}

Output:

First time run:  

Enter ten numbers: 1 2 3 4 5 6 7 8 9 10

The number of distinct numbers is 10

The distinct numbers are 1 2 3 4 5 6 7 8 9 10

Second time run:

Enter numbers: 2 3 5 8 7 4 3 2 1 2

The distinct numbers is :7

The distinct number are : 2 3 5 8 7 4 1

Explanation:

The description of the above java code can be given as:

  • In the above java code, a class is defined that is main inside a class-main function is defined in the main function firstly creating a scanner class object that is "ob" then define variables and array that are number, counts and a[].
  • To inserts array elements we use a loop. In the loop, we use integer variable number and define a condition in if block passes a function that check value count total value.
  • In the second loop, we check the condition that array elements value is greater than 0 and print all array elements.
  • The isDistinct function checks in the array two values are not the same. if the values are the same it will return false value because this function is the boolean type that returns an only boolean value.
6 0
3 years ago
PLEASE HELP!
jonny [76]

1) True. Customized screens provide an easy way to enter and view data in a table and query called reports.

2) True. New Database can be created using a blank database.

3) False. Queries are used to find specific data.

4) True. When a new database is created, we can find more than one database objects.

5) False.  The primary key is to be set unique. As it identifies an entire row in the column.

1) Status Bar = Displays button to change the page views.

2) Hyper Link = A Link to an Internet Resource.

3) Field = Information arranged vertically in a table.

4) Report = Data from a table or query in printed format.

5) Record = Information arranged horizontally in a table.

8 0
2 years ago
Please Help!! Digital Information Technology Class!!
Rama09 [41]
It’s probably GUI??.
6 0
4 years ago
Read 2 more answers
Other questions:
  • Web design people please help!
    7·1 answer
  • In scratch the location of a sprite is defined by what?
    10·1 answer
  • Which image shows organic shapes? <br> A. image 1 <br> B. image 2 <br> C. image 3 <br> D. image 4
    14·2 answers
  • A virus or worm can have a payload that installs a(n) __________ door or trap-door component in a system, which allows the attac
    14·2 answers
  • 1)Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "positive" otherwise. Examp
    15·2 answers
  • Who watches Riverdale ? if you do can we be friends(pLEASE DON'T DELETE) and also who is your fav character from Riverdale
    8·2 answers
  • What is a cloud in the world of computing
    7·1 answer
  • 1. Which one of the following is true about screening interviews?
    7·1 answer
  • Multi-part question:
    13·1 answer
  • Read each of the following statements about Computer Science and explain why you think that statement is true.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!