Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate...

20
ief Introduction to Java and C Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program Whitaker College of Engineering Florida Gulf Coast University Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Transcript of Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate...

Page 1: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Brief Introduction to Java and C#

Dahai GuoOracle Certified Java Programmer (SCJP)Associate Professor and Program Director

Software Engineering ProgramWhitaker College of Engineering

Florida Gulf Coast University

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 2: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Outline

• Java– History– Applications– Java Development Kit– Tools– Demo

• C#– Why Java Programmers Can Learn C# Quick– Demo

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 3: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Java: History

• JDK 1.0 (January 23, 1996)• JDK 1.1 (February 19, 1997)• J2SE 1.2 (December 8, 1998)• J2SE 1.3 (May 8, 2000)• J2SE 1.4 (February 6, 2002)• J2SE 5.0 (September 30, 2004)• Java SE 6 (December 11, 2006)• Java SE 7 (July 28, 2011)

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 4: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Java: History

• WHY: People were desperate for portable programs which are not hardware and operating system dependent.

• How: A program, called Java Virtual Machine, is installed to hide details of the operating system and hardware.

• So: Write once, Run anywhere!!

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 5: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Java: Applications

• Ranked #1 (2011) and #2 (2012) in the most popular programming languages. (tiobe.com)

• Android applications are all written in Java.

• Hadoop, the most popular framework for managing cloud, was written in Java.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 6: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Java Development Kit (JDK)

• Provides Java programmer with numerous classes and methods for– Developing Graphical User Interfaces (GUI)– Data processing– Multithreaded programs– Networking programs– Many more…

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 7: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Tools

• Many open source tools exist for developing Java based projects– Integrated Development Environment: Eclipse,

NetBeans– Unit Testing: JUnit– Configuration Management: TortoiseSVN– Continuous Build: CruiseControl– Game Development: JMonkeyEngine

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 8: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Tools

• Tips:– For most school projects, Eclipse should meet

your needs. – Many other tools can be integrated with Eclipse in

form of plugins.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 9: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 1

• Hello, World!– How to edit, compile, and execute Java programs

in Eclipse.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 10: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 2

• Eight-puzzle solver– Basic GUI– Image input and output– Data structures support – Artificial intelligence

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 11: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 3

• Convex hull finder:– Basic drawing methods– Timer events– Data structure support– Computational geometry

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 12: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 4

• Road graphics generator– Basic GUI with user inputs– Integration with a game engine

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 13: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 5

• Multithreaded application

RandNumGen

RandNumGen

Unlimited Size Buffer

DataCollectorrun every 30ms

Collects data every 100 ms

Disk

Internal Buffer

Disk

Disk

.

.

.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 14: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 5 (cont)

• Do not step on each other’s foot– Data collector shall not read from the unlimited

buffer when it is being written.– Random # generator shall not write to the

unlimited buffer when it is being read.– Data collector shall not update its internal buffer

when not each file saver completes.– No file saver shall save the same content more

than once.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 15: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 6

• Networked chatter– Basic GUI with user inputs– Socket communication

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 16: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

C#

• C# 1.0: December, 2002• C# 2.0: October, 2005• C# 3.0: August, 2007• C# 4.0: April, 2010

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 17: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

C#

• Why Java Programmers Can Learn C# Quick: C# is very similar to Java in syntax.

• C# programs run on the .NET framework just like Java programs run on the Java Virtual Machine.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 18: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Tools for C# Programming

• While other tools exist, Visual Studio is the mostly used tool for C# programming.

• Visual Studio can be downloaded at https://www.dreamspark.com/ for free to students.

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 19: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 1

• Hello, World!– How to edit, compile, and execute C# programs in

Visual Studio

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012

Page 20: Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program.

Demo 2

• Multi-threaded applications

Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012