COP-3330: Object Oriented Programming Course Introduction May 14, 2012 Eng. Hector M Lugo-Cordero, MS.

Slides:



Advertisements
Similar presentations
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Advertisements

1 pritisajja.info Unlocking the World of Java Programming….. Priti Srinivas Sajja February, 2014 Visit pritisajja.info for detail Future Technology for.
Chapter 1: Computer Systems
Programming with Java. Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: –Understand the.
Object Oriented Programming in Java George Mason University Fall 2011
Begin Java Pepper. Objectives What is a program? Learn the basics of your programming tool: BlueJ Write a first Java program and see it run Make some.
Dale Roberts Introduction to Java - First Program Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Lab#1 (14/3/1431h) Introduction To java programming cs425
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
CS2200 Software Development Lecture 2: Java Program Development Lecturer: Adrian O’Riordan Course Webpage:
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
How to Create a Java program CS115 Fall George Koutsogiannakis.
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Hello, world! Dissect HelloWorld.java Compile it Run it.
Introduction to Java.
Programming a computer. What does programming a computer mean ? Programming a computer: Since a computer can only execute machine instructions (encoded.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
Java Language and SW Dev’t
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Java Programming Introduction & Concepts. Introduction to Java Developed at Sun Microsystems by James Gosling in 1991 Object Oriented Free Compiled and.
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Chapter 1: Introduction to Programs, and Java 1. Objectives To review programs (§ ). To understand the relationship between Java and the World Wide.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Board Activity Find your seat on the seating chart Login – Remember your login is your first initial your last name and the last three numbers of your.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Introduction to programming in the Java programming language.
COP-3330: Object Oriented Programming Flow Control May 16, 2012 Eng. Hector M Lugo-Cordero, MS.
Department of Electrical and Computer Engineering Introduction to C++: Primitive Data Types, Libraries and Operations By Hector M Lugo-Cordero August 27,
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
A Look at Java. Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation?
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
CSc 201 Introduction to Java George Wells Room 007, Hamilton Building
By Mr. Muhammad Pervez Akhtar
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
introductory lecture on java programming
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Introduction to Object Oriented
The need for Programming Languages
GC101 Introduction to computer and program
Chapter No. : 1 Introduction to Java.
Chapter 3 GC 101 Java Fundamentals.
Yanal Alahmad Java Workshop Yanal Alahmad
Data types and variables
Chapter 1 Introduction to Computers, Programs, and Java
Java Intro III.1 (Fr Feb 23).
The Boolean (logical) data type boolean
Chapter 1: Computer Systems
Fundamentals of Programming
Introduction to Java Brief history of Java Sample Java Program
Presentation transcript:

COP-3330: Object Oriented Programming Course Introduction May 14, 2012 Eng. Hector M Lugo-Cordero, MS

Syllabus Link to syllabus As of now my webpage will have all material for the course – I will try to get a WebCT session

The Programming World Couple of programming paradigms exists – Imperative: Structural: C, FORTRAN – Functional: Scheme, Nodejs – Object Oriented: Objective-C, C++, C#, Java

What is this course about? Developing programs using the object oriented paradigm Allows abstraction of low level details giving more powerful tools to concentrate on the higher level tasks Sentences are composed of Subject, Verb, Predicate or Object – Mary eats the apple Subject: Mary Verb (action): eats Object: the apple Object oriented programming is composed of “sentences” var.addTo(temp); – Subject (an object): var – Action (method): addTo – Object (another object): temp

Problem Solving 1.Understand the problem 2.Dissect the problem into manageable pieces. 3.Design a solution. 4.Consider alternatives to the solution to refine it. 5.Implement the solution. 6.Test the solution and fix any problems that exist.

History of Java Java was developed in 1995 be James Gosling who works at Sun Microsystems. Java's ability to execute programs on the WWW caused an initial buzz. However, the language has continued to gain in popularity because of its object-oriented design. This design is very well-suited for very large programming projects. Many academics even feel that Java is an excellent first programming language to learn. Java teaches the concept of objects very well. Other languages, such as C++, do not reinforce the concept quite as well. Although C++ is good for learning memory management. Recently Sun was bought by Oracle.

A Java Program 1. // Knights.java 2. // Arup Guha 3. // 1/9/07 4. // A very simple Java program that prints to the screen. 5. public class Knights { 6./* 7.This is the main function of the program 8.*/ 9.public static void main(String[] args) { 10.System.out.println("GO KNIGHTS!!!!!!!"); 11.} 12. }

Understanding the code (comments) Single line comments are written as shown on lines 1 – 4, that is “//with some text” – It is good practice to keep your code clean and commented such that you may go back to understand it after some time – Lines 1 – 4 contain the author and some info about the code, e.g. logs, known bugs, etc. Multi line comments follow the C convention of /* anything between this is a comment */, as shown on lines 6 – 8

Class Definition Line 5 presents the definition of a class – All java code resides within classes, and each class must have a name. In main class the name should be the same filename – We shall go more into classes as the course moves on

The Main Function Line 9 presents the main function of a Java program It is not necessary to have a main function in order to have a complete Java Class – For now all classes shall have one – As in C, this is the first function that is called

Understanding Main There are several keywords on the definition of main – 1) public: access from everywhere – 2) static: the method is the same for all instances of the class – 3) void: return type, in this case none – 4) String[] args: parameters to main. Equivalent to C’s int argc, char** argv We shall go more into detail on this

System.out.println On line 10 we our first line to write something to the stdout or console in this case System.out.println works as printf in C, however it is much simpler to use since it does not require format specifiers (i.e. %c, %s, %d, %f, etc.) System.out.printf does exits as well and it is used just liked in C Other standard streams include System.in and System.err

Primitive Data Types Data TypeWrapper Class byteByte shortShort intInteger longLong floatFloat doubleDouble boolean Boolean char Character voidVoid

Variable Names Are case sensitive Can contain letters, underscores, and numbers Should not start with numbers Should be descriptive of the task, they can have any number of characters

Compilers and Interpreters Compilers translate code into machine code to generate a binary file (e.g..exe) Interpreters run the code as it reads it Java is an interpreted language, the Java Virtual Machine (JVM) runs a.class code

Creating.class files The command javac may be used as gcc with C to “compile” or create.class files which can be run by the JVM Consider the code Knights.java, to compile it javac Knights.java The above creates a.class file which may be run using java Knights Notice no.class is used (why?)