0% found this document useful (0 votes)
28 views12 pages

Computer Science E-76 Building Mobile Applications

This document is a lecture on Java for building mobile applications. It introduces Java fundamentals like variables, data types, control flow structures, and documentation resources. Key topics covered include naming conventions for variables, primitive and object variable types, using arrays, if/else and switch statements, while and for loops, and Java API and tutorial documentation links.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views12 pages

Computer Science E-76 Building Mobile Applications

This document is a lecture on Java for building mobile applications. It introduces Java fundamentals like variables, data types, control flow structures, and documentation resources. Key topics covered include naming conventions for variables, primitive and object variable types, using arrays, if/else and switch statements, while and for loops, and Java API and tutorial documentation links.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Computer Science E-76

Building Mobile Applications

Lecture 2: [Android] Java Primer


February 6, 2012
Dan Armendariz
[email protected]

API:
http://java.sun.com/javase/6/docs/api/
Tutorial:
http://java.sun.com/docs/books/tutorial/java/TOC.html

Java

Documentation
2

Begin with letters, $, or _


Subsequent characters also can be numbers
Case sensitive
No spaces
name
firstName
phoneNumber
Variables

Naming
3

abstract

continue

for

new

switch

assert

default

goto

package

synchronized

boolean

do

if

private

this

break

double

implements

protected

throw

byte

else

import

public

throws

case

enum

instanceof

return

transient

catch

extends

int

short

try

char

final

interface

static

void

class

finally

long

strictfp

volatile

const

float

native

super

while

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html

Variables

Reserved Words
4

byte
short
int
long
float
double
boolean
char
Variables

Primitive Types
5

String
BigDecimal

Variables

Objects
6

int[] grades;
grades = new int[15];

Variables

Arrays
7

if (boolean) {
// perform this code
} else {
// otherwise, run this
}

Control Flow

If-else statements
8

switch (variable) {
case 1: //code
break;
case 2: //code
break;
default: //code
}
Control Flow

Switch
9

while (boolean) {
// code
}

Control Flow

While Loops
10

for (init.; term.; update) {


// code
}

Control Flow

For Loops
11

Computer Science E-76


Building Mobile Applications

Lecture 2: [Android] Java Primer


February 6, 2012
Dan Armendariz
[email protected]

12

You might also like