lecture2-dan - Variables Primitive Types 5 byte short int...

Info icon This preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science E-76 Building Mobile Applications Lecture 2: [Android] Java Primer February 8, 2011 Dan Armendariz [email protected] 1
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Java Documentation 2 API: http://java.sun.com/javase/6/docs/api/ Tutorial: http://java.sun.com/docs/books/tutorial/java/TOC.html
Image of page 2
Variables Naming 3 Begin with letters, $, or _ Subsequent characters also can be numbers Case sensitive No spaces name firstName phoneNumber
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Variables Reserved Words 4 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
Image of page 4
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
Image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Variables Primitive Types 5 byte short int long float double boolean char Variables Objects 6 String BigDecimal Variables Arrays 7 int grades; grades = new int[15]; Control Flow If-else statements 8 if (boolean) { // perform this code } else { // otherwise, run this } Control Flow Switch 9 switch (variable) { case 1: //code break; case 2: //code break; default: //code } Control Flow While Loops 10 while (boolean) { // code } Control Flow For Loops 11 for (init.; term.; update) { // code } Computer Science E-76 Building Mobile Applications Lecture 2: [Android] Java Primer February 8, 2011 Dan Armendariz [email protected] 12...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern