Question

In: Computer Science

In JAVA A. A Java applet is a stand-alone program that does not require a web...

In JAVA

A. A Java applet is a stand-alone program that does not require a web browser. True or False

B.Which of the following are valid identifiers in java? (will the identifier compile?)

  1.   Object#Count
  2.   $money
  3.   Late_Fee
  4.   __$__

C.What is the decimal (base 10) equivalent of 162 in octal?

D.Which of these identifiers obey the naming convention for object names?

  1. Isthisokay
  2. goodName
  3. C3PO
  4. ThisIsReallyOkay
  5. areallygreatname
  6. anotherBadOne

Solutions

Expert Solution

A) False

Explanation: Java applet is a java program but can not directly run on a standalone machine.To run a applet we need a web browser which is java enabled.Hence we require a web browser and it is not stand alone.

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

B)

Rules for identifiers in Java.

1) Identifiers contain only alphanumeric characters [a-z][A-Z][0-9], Dollar($) and underscore ( _ )

2) It should not start with numbers.

3) It should not be a reserved word in Java.

  1. Object#Count - Invalid. It contains '#' , which is not allowed in Java identifiers
  2.   $money - Valid.
  3.   Late_Fee - Valid
  4.   __$__ - Valid

The above valid identifiers are valid because they hold the above mentions rules.

If the identifiers are invalid , they dont get complied,(we get an error).

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

C)

Given to find decimal equivalent of (162)8

= 64 + 48 + 2=114.

Answer 114.

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

D)Naming convention for objec names:

  1. Start with a lower case letter
  2. Do not start with dollar or underscore.
  3. It should be mnemonic

4.If the name contains more than one word, start with a lower case letter of first word and next word should start with upper case. Example: functionName

Isthisokay - Does not obey . As this is starting with uppercase letter .

Correct Convention- isThisOkay

goodName - Obey. As this is starting with lower case letter and next word is started with upper case letter.

C3PO - Does not Obey .As starting with upper case letter.

ThisIsReallyOkay - Does not Obey. As starting with upper case letter.

Correct convention: thisIsReallyOkay

areallygreatname - Does not Obey. As the first letter of next word is not upper case.

Correct convention: aReallyGreatName

anotherBadOne - Obey. As this is starting with lower case letter and next word is started with upper case letter.


Related Solutions

2. 2: Risk and Rates of Return: Stand-Alone Risk Stand-alone risk is the risk an investor...
2. 2: Risk and Rates of Return: Stand-Alone Risk Stand-alone risk is the risk an investor would face if he or she held only _______ . No investment should be undertaken unless its expected rate of return is high enough to compensate for its perceived _______ . The expected rate of return is the return expected to be realized from an investment; it is calculated as the ________ of the probability distribution of possible results as shown below: The _______...
Risk and Rates of Return: Stand-Alone Risk Stand-alone risk is the risk an investor would face...
Risk and Rates of Return: Stand-Alone Risk Stand-alone risk is the risk an investor would face if he or she held only _________________ . No investment should be undertaken unless its expected rate of return is high enough to compensate for its perceived _________________ . The expected rate of return is the return expected to be realized from an investment; it is calculated as the _________________ of the probability distribution of possible results as shown below: The _________________ an asset's...
(Java program) Write an applet that draws two animated cars that must race each other. The...
(Java program) Write an applet that draws two animated cars that must race each other. The race cars should move along a straight line, with each starting behind a Start Line. The user should have the option to set the speed of each car. The speed range is 0 to 100. There should be a Start button to begin the race and an End button to stop the race at any time.
What is counterfactual research and is it considered a stand alone research methodology?
What is counterfactual research and is it considered a stand alone research methodology?
What does the acronym HVBP stand for and what is the purpose of its’ program? this...
What does the acronym HVBP stand for and what is the purpose of its’ program? this question from Health Information system course and I need a brief answer.
find the below requirments is business case for a stand alone solar powered cooker that will...
find the below requirments is business case for a stand alone solar powered cooker that will provide 4 hours cooking per day for a family group. assume 11 hours of regular sunlight. as well as technical side you will need to develop the business case for this requirement. 1.how much power is required to cook 4hours per day. 2.how many solar panels is required for accurate cooking 3.cost must be low, and consider the suitable region like india. 4.A battery...
The following accounts appeared in the stand alone financial statements of P, Inc. at the end...
The following accounts appeared in the stand alone financial statements of P, Inc. at the end of 2014. P acquired 100% of the common stock of S, Co. on January 1, 2014 at book value. On the date of acquisition, S had common stock of $20,000, additional paid in capital of $380,000, and retained earnings of $339,000. P received $24,000 in dividends during 2014 and does not own any other equity investments. P Investment in subsidiary 660,000 Common stock 300,000...
Business Finance Detailed analysis of statistical methods to access stand alone risk?
Business Finance Detailed analysis of statistical methods to access stand alone risk?
Java Programming Explain what is MVC. What does is stand for and explain what MVC suggests...
Java Programming Explain what is MVC. What does is stand for and explain what MVC suggests for the different parts of an Application? [PLEASE STOP COPY AND PASTE ANSWERS FROM OTHERS]
The coefficient of variation is a better measure of stand-alone risk than standard deviation because it...
The coefficient of variation is a better measure of stand-alone risk than standard deviation because it is a standardized measure of risk per unit; it is calculated as the -Select-correlation coefficientrisk premiumstandard deviationCorrect 5 of Item 1 divided by the expected return. The coefficient of variation shows the risk per unit of return, so it provides a more meaningful risk measure when the expected returns on two alternatives are not -Select-identicaldifferentcorrelatedCorrect 6 of Item 1. The Sharpe ratio compares the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT