Home arrow Java & J2EE arrow Page 4 - Primitive Data Types and Basic Language Rules for Java

A Few More Rules - Java

Last time we discussed some basic concepts related to object-oriented programming. Two major ideas we defined were objects and variables. In this article, we will continue our discussion of variables by explaining how they hold and interact with data.

TABLE OF CONTENTS:
  1. Primitive Data Types and Basic Language Rules for Java
  2. Working with Arrays
  3. Multidimensional Arrays
  4. A Few More Rules
By: James Payne
Rating: starstarstarstarstar / 15
September 24, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Java likes to separate the men from the boys, the hair from your head, and the code that you write. To do this, we use separators (didn't see that coming did you?).

Separators

Below is a list of separators and their functions.

How it Looks

Name

Function

.

Period

Separates package names from subpackages and classes. Can also be used to separate a variable or method from a reference variable.

;

Semicolon

Ends statements.

,

Comma

Separates identifiers when declaring variables.

{}

Braces

No not for your teeth. Contains the values of initialized arrays. Also for declining a block of code, classes, methods, local scopes.

[]

Brackets

For declaration of array types or dereferencing array values.

()

Parentheses

Holds lists of parameters in method definition, defining precedence in expressions, holding expressions in control statements, and encasing cast types

Keywords

As part of its diverse vocabulary, Java has 49 reserved keywords. These keywords cannot be used to name a variable, class, or method, and will not magically open doors (rely on good ole' "open sesame" for that one). You want to see what they look like in a table? Well here they are:

abstract

assert   

boolean

break

byte

case

catch

char

class

const

continue

default

do

double

else

extends

final

finally

float

for

goto

if

implements

import

instanceof

int

interface

long

native

new

package

private

protected

public

return

short

static

strictfp

super

switch

synchronized

this

throw

throws

transient

try

void

volatile

while

Final Notes

That concludes this episode of Beginning Java Programs. In the next article we will discuss Operators and putting those lazy variables to work.



 
 
>>> More Java & J2EE Articles          >>> More By James Payne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

JAVA & J2EE ARTICLES

- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: