Java and C# [this is a bonus – it is not a required lesson] ACO101: Introduction to Computer Science.

Slides:



Advertisements
Similar presentations
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Advertisements

Object Oriented Programming in Java George Mason University Fall 2011
Object Orientated Programming
Introduction to Java Programming
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Introduction to Java ISYS 350. A Brief History Sun Microsystems released this language in 1996 – Versions: 1.0 – 1.6 Java Development Kit, JDK – Standard.
Tutorial 1 Introduction to Java Programming Bo Chen Department of Computer Science.
How to install Java CSC 2310 D M Rasanjalee. Steps 1.Download Java 2.Install Java 3.Update Path environmental variable 4.Verify Installation.
Introduction to Java.
CS0007: Introduction to Computer Programming Setting Up Java.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Java PAL.  Contains the development kit and the runtime environment ( aka the Java Virtual Machine )  Download Link:
Introduction to Java Programming. Contents 1. Java, etc. 2. Java's Advantages 3. Java's Disadvantages 4. Types of Java Code 5. Java Bytecodes 6. Steps.
IB Computer Science II Paul Bui
Introduction to Java Tonga Institute of Higher Education.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
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.
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.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Chapter 1© copyright Janson Industries Java ▮ Java programming concepts ▮ Downloading the JDK ▮ Java coding and executing example This presentation.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
FRST JAVA PROGRAM. Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
Java ACO101: Introduction to Computer Science. The History of Java Started out as a research project at Sun Microsystems in 1991 Code named “Green” Based.
1 CSC204 – Programming I Lecture 2 Intro to OOP with Java.
POS 406 Java Technology And Beginning Java Code
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
( ) 1 ISYE 7210—Fall 2005 Design of Real-Time Interactive Simulations (in Java) Initial Notes Christine M. Mitchell Director & Professor Center for.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
CS591x A very brief introduction to Java. Java Developed by Sun Microsystems was intended a language for embedded applications became a general purpose.
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Setting Up Eclipse. What is Eclipse? Eclipse is a free, downloadable software that allows us to create, compile, and run JAVA programs.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
CS Software Studio Java Lab 1 Meng-Ting Wang PLLAB, Computer Science Department, National Tsing-Hua University.
EIE375 BlueJ: Getting Started Dr Lawrence Cheung.
Lecture.1: Getting Started With Java Jiang (Jen) ZHENG May 9 th, 2005.
Welcome to java installation. After download java software, assuming you downloaded jdk1.7.0_11 Follow the procedure bellow to install java.
 Instructor: Dr. Jason Nichols –  Office Hours: – 9:30-10:30 M/W/F or by appointment – Business Building.
22-July-2002cse142-13B-Development © 2002 University of Washington1 Development Tools CSE 142, Summer 2002 Computer Programming 1
introductory lecture on java programming
CSCI 212 Object-Oriented Programming in Java. Prerequisite: CSCI 111 variable assignment statement while loop for loop post-increment (i++) strong typing.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Introduction to Programming 1 1 2Introduction to Java.
Computer Science I Lab 1 ISMAIL ABUMUHFOUZ | CS 180.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.
CompSci 230 S Programming Techniques
CS210 Intermediate Computing with Data Structures (Java)
Lecture 1b- Introduction
Internet and Java Foundations, Programming and Practice
1. Environment Setting Minhaeng Lee.
Programming without BlueJ Week 12
Introduction to Java Dept. Business Computing University of Winnipeg
Getting Started ARCS Lab..
How to Run a Java Program
Java Intro.
Run Java file with Window cmd
(Computer fundamental Lab)
IB Computer Science II Paul Bui
Review of Previous Lesson
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

Java and C# [this is a bonus – it is not a required lesson] ACO101: Introduction to Computer Science

Runtime environments Java Java Runtime Environment – Includes the JVM and Common Code Libraries JVM = Java Virtual Machine The JRE was originally designed to support interpreted execution with final compilation as an option. The Java compiler produces Java bytecode C# Common Language Runtime The CLR is designed to execute fully compiled code. The C# compiler produces Common Intermediate Language instructions.

Program execution Java bytecode is loaded by the Java runtime and either interpreted directly or compiled to machine instructions and then executed C# the runtime loads Common Intermediate Language code and compiles to machine instructions on the target architecture

Installation Check JDK Go to Start > Run > type “cmd” in the box to launch a command prompt – Type in the window (where the cursor is) java –version.NET Framework Software Development Kit (SDK)

Location Java C:\Program Files\Java – In folder named jdk1.6.0_21 click into the bin in that folder – C:\Program Files\Java\jdk1.6.0_21\bin – javac.exe is the compiler C# C:\Windows\Microsoft.NET \Framework You will see several different versions – Inside a version folder you will see a csc.exe – This is the compiler program

CSC.EXE The command line C# compiler is a program named CSC.EXE. This program makes use of a dynamic link library named CSCOMP.DLL that contains the actual compiler code.

To DIY you will need The Java SE Development Kit 6 (JDK 6) hnetwork/java/javase/down loads/index.html hnetwork/java/javase/down loads/index.html Download and follow the installation wizard.NET Framework Software Development Kit (SDK) downloads/details.aspx?Fa milyID=fe6f2099-b7b4-4f47- a244- c96d69c35dec&displaylang =en downloads/details.aspx?Fa milyID=fe6f2099-b7b4-4f47- a244- c96d69c35dec&displaylang =en Download and follow the installation wizard Or install Visual Studio 2008 and/or Visual Studio 2010

Hello world Java package hello; class myfirstjavaprog { public static void main(String args[]) { System.out.println("Hello World!"); } C# namespace Hello { public class HelloWorld { public static void Main(string[] args) { System.Console.WriteLine("Hello, World!"); System.Console.ReadLine(); } } }

Save as…. Java myfirstjavaprog.java C# myfirstcharpprog.cs

Bring up a command prompt For java - Start > Run > cmdFor c#

Change the directory to the location of Java – the compiler C:\Program Files\Java\jdk1.6.0_21\bin C# -- the file to be compiled (it will different on your computer than on mine)

Now send the your file to the compiler (these have both been run in the screenshot) javac [location and name of.java file] csc /target:exe [name of file]

Now go check to see if you have a javaC#.exe file.class file

Let’s run it – Java: go to the location of the class (current working directory) and pass the name of the class to the Java runtime C# Double click on the exe

Success! JavaC#

Hungry for more? Java /javase/tutorial/java/packag e/packages.html /javase/tutorial/java/packag e/packages.html /Java_package /Java_package C# en- us/library/ms379563%28VS. 80%29.aspx#csharpcompile r_topic4 en- us/library/ms379563%28VS. 80%29.aspx#csharpcompile r_topic4 /2006/02/namespaces-in-c/ /2006/02/namespaces-in-c/