200 likes | 529 Views
Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012. Brief Introduction to Java and C# Dahai Guo Oracle Certified Java Programmer (SCJP) Associate Professor and Program Director Software Engineering Program Whitaker College of Engineering
E N D
Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012 Brief 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 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 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 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 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 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 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 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 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 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 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 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 Demo 5 Disk • Multithreaded application Disk Collects data every 100 ms RandNumGen Data Collector . . . Unlimited Size Buffer run every 30ms RandNumGen Internal Buffer Disk
Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012 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 Demo 6 • Networked chatter • Basic GUI with user inputs • Socket communication
Computer Science, Software Engineering & Robotics Workshop, FGCU, April 27-28, 2012 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 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 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 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 Demo 2 • Multi-threaded applications