Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
const and goto arent actually used java

Const and goto arent actually used java

Declaring and Initializing Variables 27

of type double. Although that’s true, it still isn’t allowed. If you want to declare multiple variables in the same statement, they must share the same type declaration and not repeat it. double d1, d2; would have been legal.

i4;// DOES NOT COMPILE

Looking at the last line on its own, you can easily see that the declaration is invalid.

■ The name must begin with a letter or the symbol $ or _.

■ Subsequent characters may also be numbers.

28

byte

abstract assert

boolean

catch
continue default

do

double

extends

finally

float

for
instanceof

int

interface

new

private

protected

strictfp super

switch

synchronized

throws transient

void

volatile

while

Although you can do crazy things with identifi er names, you shouldn’t. Java has con-ventions so that code is readable and consistent. This consistency includes CamelCase. In CamelCase, each word begins with an uppercase letter. This makes multiple-word variable names easier to read. Which would you rather read: Thisismyclass name or ThisIsMyClass name? The exam will mostly use common conventions for identifi ers, but not always. When you see a nonstandard identifi er, be sure to check if it is legal. If not, you get to mark the answer “does not compile” and skip analyzing everything else in the question.

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Sean Moore

PageId: DOC94481D1