Java Basics Kris Secor Mobile Application Development.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Programming Languages and Paradigms The C Programming Language.
Fundamental Programming Structures in Java: Control Flow, Arrays and Vectors.
Written by: Dr. JJ Shepherd
CS 106 Introduction to Computer Science I 02 / 18 / 2008 Instructor: Michael Eckmann.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Loops – While, Do, For Repetition Statements Introduction to Arrays
CS 225 Java Review. Java Applications A java application consists of one or more classes –Each class is in a separate file –Use the main class to start.
Guide To UNIX Using Linux Third Edition
Hello, world! Dissect HelloWorld.java Compile it Run it.
Java Tutorial Write Once, Run Anywhere. Java - General Java is: –platform independent programming language –similar to C++ in syntax –similar to Smalltalk.
 Java is:  platform independent programming language  similar to C++ in syntax  similar to Smalltalk in mental paradigm  Java has some interesting.
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Review Review Review. Concepts Comments: definition, example, different types of comments Class: definition, example Object: definition, example Data.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
CSC Java Programming, Fall, 2008 Week 2: Java Data Types, Control Constructs, and their C++ counterparts, September 4.
Basic Java Programming CSCI 392 Week Two. Stuff that is the same as C++ for loops and while loops for (int i=0; i
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
1 © 2002, Cisco Systems, Inc. All rights reserved. Arrays Chapter 7.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
Fundamental Programming: Fundamental Programming Introduction to C++
Primitive data Week 3. Lecture outcomes Primitive data – integer – double – string – char – Float – Long – boolean Declaration Initialisation Assignments.
Conditions CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Chapter 7 Selection Dept of Computer Engineering Khon Kaen University.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Getting Started Java Fundamentals CSC207 – Software Design Summer 2011 – University of Toronto – Department of Computer Science.
C++ / G4MICE Course Session 2 Basic C++ types. Control and Looping Functions in C Function/method signatures and scope.
© M. Gross, ETH Zürich, 2014 Informatik I für D-MAVT (FS 2014) Exercise 4 – Logical Operators & Branching.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
C++ / G4MICE Course Session 1 - Introduction Edit text files in a UNIX environment. Use the g++ compiler to compile a single C++ file. Understand the C++
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Written by: Dr. JJ Shepherd
2: Basics Basics Programming C# © 2003 DevelopMentor, Inc. 12/1/2003.
An Introduction to Java – Part 1 Erin Hamalainen CS 265 Sec 001 October 20, 2010.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
CSC Java Programming, Spring, 2010 Week 2: Java Data Types, Control Constructs, and their C++ counterparts.
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Object Oriented Programming Lecture 2: BallWorld.
Windows Programming Lecture 03. Pointers and Arrays.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
Primitive data types Lecture 03. Review of Last Lecture Write a program that prints the multiplication table of 5. class MultiplicationTable { public.
(Java Looping and Conditional Statements). Flow of control Sequential Executes instructions in order Method Calls Transfer control to the methods, then.
Foundations of Programming: Java
Lecture 2 D&D Chapter 2 & Intro to Eclipse IDE Date.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Programming Languages and Paradigms
Java for Android is specific
Programming Paradigms
C Basics.
Java Programming: From Problem Analysis to Program Design, 4e
An Introduction to Java – Part I, language basics
An overview of Java, Data types and variables
IFS410 Advanced Analysis and Design
Introduction to Primitive Data types
Sridhar Narayan Java Basics Sridhar Narayan
Recap Week 2 and 3.
Java Programming Review 1
Java: Variables, Input and Arrays
Module 3 Selection Structures 6/25/2019 CSE 1321 Module 3.
Review of Java Fundamentals
Introduction to Primitive Data types
Presentation transcript:

Java Basics Kris Secor Mobile Application Development

 Can Break a Man (or woman!)…  Best thing to do is dive in…  Don’t show fear in the courtyard  Learn Some Programming and dive in to app development as soon as possible. Mobile Application Development

 6:30-7:00 - Course intro (Text/Screencast channel/requirements)  7:00-7:30 The tools/resources (Android Studio/Eclipse/Java/Android SDK/developer.android.com/compileonline/)  7:30-7:45 Quick break to get refreshed.  7:45-8:15- Install and tour  8:15-9:30- Running Java/Variables/Data/Operators/Conditionals/Scanner Classes Exercises and Homework Mobile Application Development

 The Java we'll need to learn first is:  The core language  Collections  IO  String handling  We will not need to learn Servlets or Swing or a few other java concepts as this is about developing for android Mobile Application Development

 Learn to write simple code  Learn to understand complex code  Understand and accept encapsulation and be able to use the android libraries  Get experience at troubleshooting  Get one app under our belts  Have realistic expectations Mobile Application Development

 Mm214.com  The texts  Eclipse. Feel free to download Kepler. I use indigo. You can read why hereKeplerhere  Android SDK. We will download this in a couple of weeks.  Emulators  Java Docs Java Docs  Java Docs for Android Java Docs for Android  Snippets Snippets Mobile Application Development

 boolean, char, byte, short, int, long, float, double etc. boolean, char, byte, short, int, long, float, double etc.  These basic (or primitive) types are the only types that are not objects (due to performance issues).  This means that you don’t use the new operator to create a primitive variable.  Declaring primitive variables: float initVal; int retVal, index = 2; double gamma = 1.2, brightness boolean valueOk = false;

 If no value is assigned prior to use, then the compiler will give an error  Java sets primitive variables to zero or false in the case of a boolean variable  All object references are initially set to null  An array of anything is an object ◦ Set to null on declaration ◦ Elements to zero false or null on creation

int index = 1.2; // compiler error boolean retOk = 1;// compiler error double fiveFourths = 5 / 4; // no error! float ratio = 5.8f;// correct double fiveFourths = 5.0 / 4.0;// correct  1.2f is a float value accurate to 7 decimal places.  1.2 is a double value accurate to 15 decimal places.

 All Java assignments are right associative int a = 1, b = 2, c = 5 a = b = c System.out.print( “a= “ + a + “b= “ + b + “c= “ + c)  What is the value of a, b & c  Done right to left: a = (b = c);

 * / % + - are the mathematical operators  * / % have a higher precedence than + or - double myVal = a + b % d – c * d / b;  Is the same as: double myVal = (a + (b % d)) – ((c * d) / b);

 A simple statement is a command terminated by a semi-colon: name = “Fred”;  A block is a compound statement enclosed in curly brackets: { name1 = “Fred”; name2 = “Bill”; }  Blocks may contain other blocks

 Java executes one statement after the other in the order they are written  Many Java statements are flow control statements: Alternation: if, if else, switch Looping:for, while, do while Escapes:break, continue, return

 Open Eclipse and Create a new Java project  Lets focus on output.  Then variables and data typing  Then user entry using the Scanner class  Then some logic problems Mobile Application Development