350 likes | 512 Views
Programming with Java . COP 2800 Lake Sumter State College Mark Wilson, Instructor. Programming with Java. Introductions. Around the Room. Who are you? What is your current educational goal? What do you know about computers and programming?
E N D
Programming with Java COP 2800 Lake Sumter State College Mark Wilson, Instructor
Programming with Java Introductions
Around the Room Who are you? What is your current educational goal? What do you know about computers and programming? Why are you here (what do you want to get out of this course)?
The Instructor Mark Wilson (wilsonm@lssc.edu) Software Engineer and IT Manager Since 1980 BA, Psychology from Stetson, 1977 MS, Computer Information Systems from FIT, 2011
Programming with Java Syllabus
Textbook and Reference • Head First Java • By Kathy Sierra, Bert Bates • Publisher: O'Reilly Media • Released: February 2005 • ISBN: 978-0596009205 • Oracle Java SE Documentation • http://www.oracle.com/technetwork/java/javase/documentation/api-jsp-136079.html?ssSourceSiteId=ocomen
Development Environment • You must have access to a computer to successfully complete this course • Required • Windows 7 SP1 or Windows 8.1 • Oracle Java SE JDK 7u45 or later • Eclipse IDE for Java Developers – Kepler SR 1 or later • Optional (time permitting) • Google Android SDK with ADT bundle or • Google Android Studio
Objective and Outcomes Learn fundamentals of programming using Java Use the constructs of the Java programming language as building blocks to develop correct, coherent programs. Analyze problems, develop object-oriented designs that solve those problems, and transform those designs to Java programs. Understand the fundamentals of object-oriented programming using the Java programming language. Program using the fundamental software development process, including design, coding, documentation, testing, and debugging.
Performance Measurement • Programming assignments 50% • Must compile and run without error. • Must meet the requirements. • Must include adequate documentation. Spelling and grammar count. • Must follow published coding standards • Must demonstrate good programming practices. • Must be turned in electronically no later than midnight of the due date. • Mid-term exam 15% • Term project 20% • Final exam (cumulative) 15%
Attendance Roll each class session via sign-in list You should make every effort to attend each class meeting since class discussion will include material not found in the textbook. Withdrawal deadline: Friday, March 21, 2014
Programming with Java History
In the Beginning… Computers were programmed using 1’s and 0’s Each computer had it’s own “machine language” All programs, including operating systems had to be completely rewritten for each new computer Debugging approached impossible
Assembly Engineers started seeing patterns Effective debugging required human readable instructions Assemblers converted human readable code to machine language Assembly language tended to remain the same for a given model line
Compilers The next level of abstraction Programmers needed to be able to port code to many other computers Early compilers created assembly language Current compilers generate machine language FORTRAN – FORmulaTRANslating System COBOL – COmmonBusiness-Oriented Language
Procedural Programming Fortran and Cobol are difficult languages Kemeny and Kurtz (Dartmouth) created BASIC (Beginner's All-purpose Symbolic InstructionCode) in 1964 to teach programming concepts Implemented as an interpreter in the 70’s CBASIC compiled to intermediate code Visual Basic is BASIC in name only
Structured Programming • Method to • Produce provably correct code • Improve clarity (readability) • Reduce development time • Defined a small set of well formed constructs and rules for their use • Bohm, Jacopini, Dijkstra, Hoare, et. al. • Came to the fore in 1970’s • ALGOL, Pascal, PL/1, JOVIAL, C
Object Oriented Programming • A method to: • Increase understanding. • Reduce maintenance. • Support evolution. • Concepts as objects • Objects have attributes and behaviors • Extends structured programming concepts • Components based development • Smalltalk, Ada, C++, C#, Java
Enter Java • Originally developed by Sun Microsystems • Became an Oracle product when Oracle bought Sun • Abstracted from the hardware • Java Virtual Machine • Integral Object Oriented Programming • Derived from C and C++ • Portable code • Interpreter • Machine independent “bytecode”
Why Java Web development (deprecated) Server room applications Legacy applications Android applications
Programming with Java Java and the Virtual Machine
Programming in Java Development Environment
Java SE • Java Platform, Standard Edition • JDK – Java for developers • Server JRE – Server version of Java Runtime Environment • JRE – Java Runtime Environment for end-users • Free download from Oracle • http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html • Install using defaults
Eclipse for Java • Integrated Development Environment • Open Source Software • Eclipse IDE for Java Developers • Code Recommenders Developer Tools • Eclipse Git Team Provider • Eclipse Java Development Tools • Maven Integration for Eclipse • Mylyn Task List • WindowBuilder Core • Eclipse XML Editors and Tools • Download and extract • Must be able to find Java (Java in the path)
Programming with Java Hello World
Origins of Hello World • Formally introduced by Kernighan and Richie • Introduces basics for • Minimum required source code • Fundamental syntax • Build process from source to executable
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } }
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } } Block comments begin with /* and end with */. Nothing in between executes.
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } } Everything in Java is a class including the application which must be public.
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } } Classes (and other blocks of code) are enclosed in “curly braces”.
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } } Classes contain attributes and methods or behaviors. This is a method. Every application class must have a main method and it must be public.
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } } A method within a class within another class.
Hello World for Java /* * The HelloWorldApp class implements an application that * simply prints "Hello World!" to standard output. */ public class HelloWorldApp{ public static void main(String[] args) { System.out.println("Hello, World"); } } Let’s see how it works…