Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the following about java programming. -------------------------------------------------------- (a) What is the difference between a run-time error and a compile-time error? (b) Which of the two

Answer the following about java programming.

--------------------------------------------------------

(a) What is the difference between a run-time error and a compile-time error? (b) Which of the two is also referred to as a logical error? (c) What is an exception? Give an example. (d) What kind of error can produce an exception?

----------------------------------------------------------- What does the modifier final do to a variable?

---------------------------------------------------------

(a) Explain the difference between a primitive data type and an object data type in Java. (b) List the eight primitive Java data types. ---------------------------------------------------------------------------------

To distinguish between positive and negative numbers using binary digits, a 0 is added to the beginning of the string if the decimal number it represents is positive while 1 is added if the number is negative. For example, using 5-bit strings to represent 12 and 12 respectively, we would see (12)10 = (01100)2 while ( 12)10 = (11100)2. Under this convention, explain why the largest number a byte can store is 127.

--------------------------------------------------------------

You are given two tasks. Task 1 requires that you store a list of 50 phone numbers, while Task 2 requires that you store a list of names of visitors to a hospital. Explain whether you would use an array or an array list to complete each task.

-----------------------------------------------------------------------------------

Consider the following lines of code:

package kapiva; public class PrimitiveVsObject { public static void main(String[] args) { int[] ages = {1, 2, 3, 4, 5, 2}; int numChildren = ages.length; System.out.println("There are " + numChildren+" children in the daycare center today."); System.out.println("Here are their ages: "+ages); } } OUPUT: There are 6 children in the daycare center today. Here are their ages: [I@15db9742 (a) (Explain why the expected output is printed for numChildren but not for ages. (b) What is printing for the object name ages?

-------------------------------------------------------

(a) What is a reference? (b) What does it mean to pass data to a method by value? (c) What does it mean to pass data to a method by reference?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

Students also viewed these Databases questions

Question

Is the document well organized?

Answered: 1 week ago