Introducing Java CSC1401. Course Goals Teaching programming concepts In a “real” language.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
How to Create a Java program CS115 Fall George Koutsogiannakis.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
public static void main (String[] args)
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Shorthand operators.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
04-Intro-Object-Oriented-In-Java1 Barb Ericson Georgia Institute of Technology Sept 2009 Introduction to Object-Oriented Programming in Java.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
LESSON 2 CREATING A JAVA APPLICATION JAVA PROGRAMMING Compiled By: Edwin O. Okech [Tutor, Amoud University]
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Introduction to Programming Writing Java Beginning Java Programs.
Java: Chapter 1 Computer Systems Computer Programming II.
Georgia Institute of Technology Barb Ericson Georgia Institute of Technology May 2006 Teaching Java using Turtles part 1.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Java Spring PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
POS 406 Java Technology And Beginning Java Code
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.
Programming Concept Chapter I Introduction to Java Programming.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Programing Basics COMP.
CPSC1301 Computer Science 1 Overview of Dr. Java.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Programing Basics COMP.
CIT 590 Intro to Programming First lecture on Java.
Copyright © Curt Hill Turtles The beginning of media computation.
1 CSC 221: Computer Programming I Spring 2008 Objects and classes: a broad view  software objects, classes, object-oriented design  BlueJ IDE, compilation.
Introduction to Programming Writing Java Beginning Java Programs.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and web applications Very rich GUI libraries Portability (machine independence) A real Object.
Georgia Institute of Technology Simulations Barb Ericson Jan 2005.
22-July-2002cse142-13B-Development © 2002 University of Washington1 Development Tools CSE 142, Summer 2002 Computer Programming 1
Georgia Institute of Technology Creating Classes part 4 Barb Ericson Georgia Institute of Technology May 2006.
CreatingClasses-SlideShow-part41 Creating Classes part 4 Barb Ericson Georgia Institute of Technology Dec 2009.
Review for test! Alice Chapter 1&2 Test is tomorrow! - March 26 th March 25th.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Georgia Institute of Technology Barb Ericson Georgia Institute of Technology Aug 2006 Introduction to Object-Oriented Programming in Alice and Java.
First Programs Chapter 2 The Java language (compiler) on CD ROM Create a program using an editor Compile the program Run the program Integrated Development.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Time to upload Virtual something.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington Java Programing Basics COMP.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Introduction to Object Oriented
Appendix A Barb Ericson Georgia Institute of Technology May 2006
The eclipse IDE IDE = “Integrated Development Environment”
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Java programming lecture one
Introduction to Object-Oriented Programming in Java
Introduction to javadoc
Teaching Java using Turtles part 1
Using Objects in Alice.
Introduction to Object-Oriented Programming in Alice
Running a Java Program using Blue Jay.
Teaching Java using Turtles
The beginning of media computation Followed by a demo
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Introducing Java CSC1401

Course Goals Teaching programming concepts In a “real” language

Course Approach Alternate between Alice and Java as we learn programming concepts Some concepts we’ll explore first in Alice Others we’ll explore first in Java The problem of Java It’s hard We’ll use specially created graphics libraries to help us

Java libraries What is a Java library? It’s just a class or several classes In Alice, classes were located Local Gallery CD Gallery Web Gallery In Java, we’ll need to tell the computer where to find the classes Setting the classpath (this is the directory where the classes will be located) Or, using an import statement in our Java program We’ll see how to do this in lab on Friday

Important object-oriented concepts Class Object Method Parameter Sequencing (Do in order vs. Do together) Design

Alice Java similarities We are going to find that Alice and Java are quite similar, and that concepts learned in one language immediately apply to the other There are some differences, mostly mechanical, between the 2 languages

Some differences between Java and Alice Alice uses a drag and drop editor Java has Integrated Development Environments (IDEs) that generally require typing code. We’ll be using one called JGrasp

Alice-Java Differences Classes are found in the local gallery, the CD gallery, or the web gallery Classes can be located anywhere, but you need to tell the computer where they are

Alice-Java Differences The main program is generally world.my first method The main program is generally public static void main (String [] args)

Alice-Java Differences In Alice, objects are added to a world by dragging them and dropping them into position In Java, we use the new keyword. We also use the constructor to specify such things as where to place them.

Alice-Java Differences In Alice each method is located on a separate window – but you can export all of the dragon’s methods into a single html file In Java, all of the methods for a single class are in one window

Alice – Java Differences File names always end in.a2w (and sometimes.a2c) File names always end in.java

Alice-Java Differences To run an Alice program, just click on the play button Running a Java program is a 2-step process: 1)Click on compile. This will make sure you don’t have any typos and generates a.class file 2)Click on Run

Alice-Java differences In Alice, an object’s methods are located in the object pane at the lower left of the screen In Java, we need to look at an html file (called Javadoc- short for Java documentation) to see an object’s methods

Alice – Java differences In Alice most objects (except for billboards) are 3D In Java, most of our objects will be 2D. Java supports 3D, but it’s much harder to program.

Java Example: Turtles We will work with Turtles in a World in Java We do this by writing a Turtle class definition Turtle.java We compile it to convert it into something the computer can understand Bytes codes for a virtual machine Turtle.class

History of Turtles Seymour Papert at MIT in the 60s By teaching the computer to do something the kids are thinking about thinking Develop problem solving skills Learn by constructing and debugging something Learn by making mistakes and fixing them

JGrasp Demo Opening a new Java file

Using Turtles Add bookClasses to your classpath to use these classes

Telling JGrasp where to find the Turtle class

Classpath part 2 Then click on OK Then click on Apply Then click OK →

Turtle Demo Writing a Turtle program class public static void main(String [] args) {} versus ; // and /* new Compiling and running and stopping Looking at the Javadoc

Assignment Read Media Computation Chapter 3, Sections 1 through 5 Classes Objects Methods