Java Basics - Prashant Nagaraddi. Features of Java n Java syntax is similar to C/C++ but there are many differences too n Java is strongly typed like.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

CSci 1130 Intro to Computer Programming in Java
In Review JAVA C++ GUIs - Windows Webopedia.com.
JAVA Programming Environment © Juhani Välimäki 2003.
Object Oriented Programming in Java George Mason University Fall 2011
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
T-diagrams “Mommy, where do compilers come from?” Adapted from:
1 Programming Languages b Each type of CPU has its own specific machine language b But, writing programs in machine languages is cumbersome (too detailed)
CENG 161 Introduction to Computer Science Instructor: Dr. Nurdan SARAN Lab Assistant: Arzu Burçak Sönmez.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
Introduction to Java.
Introduction to the JDK Java for Computational Finance
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
CS0007: Introduction to Computer Programming Setting Up Java.
Using the Java programming language compiler. Review of relevant material from previous lectures From previous lectures: A computer can only execute machine.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 1
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
Introduction to Java Tonga Institute of Higher Education.
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
How Java Programs Work MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
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.
Chapter 1.4 Programming languages Homework Due: Monday, August 11, 2014.
Introduction to the Java Virtual Machine 井民全. JVM (Java Virtual Machine) the environment in which the java programs execute The specification define an.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
FRST JAVA PROGRAM. Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications.
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 and C# [this is a bonus – it is not a required lesson] ACO101: Introduction to Computer Science.
Introduction to C++ Programming Language
POS 406 Java Technology And Beginning Java Code
Java Programming, Second Edition Chapter One Creating Your First Java Program.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
Object Oriented Programming Lecture 3. Introduction  In discussing Java, some items need to be clarified  The Java programming language  The Java virtual.
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.
Getting started with Programming using IDE. JAVA JAVA IS A PROGRAMMING LANGUAGE AND A PLATFORM. IT CAN BE USED TO DELIVER AND RUN HIGHLY INTERACTIVE DYNAMIC.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
By: Cheryl Mok & Sarah Tan. Java is partially interpreted. 1. Programmer writes a program in textual form 2. Runs the compiler, which converts the textual.
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
1 Introduction Read D&D Sec 1.8; Sec 1.13 THE Java tutorial -
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.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
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.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
CIS 234: Object-Oriented Programming with Java
Before You Begin Nahla Abuel-ola /WIT.
Topic: Difference b/w JDK, JRE, JIT, JVM
Introduction to.
Introduction to Java Dept. Business Computing University of Winnipeg
Introduction CSC 111.
Review of Previous Lesson
Programming language translators
Presentation transcript:

Java Basics - Prashant Nagaraddi

Features of Java n Java syntax is similar to C/C++ but there are many differences too n Java is strongly typed like C++ u Type inconsistencies are detected at compile time n Java is an Object-Oriented Language u Computation is achieved via interacting objects (more on this later)

Features of Java n Java is an interpreted language u Java source code is translated into Java bytecodes by Java compiler u These form the instructions to a Java Virtual Machine (Java VM) u The Java VM interprets the bytecodes and as a result, executes real machine instructions Hello.javaHello.classjavacjava Source Codebytecode compilerbytecode fileInterpreter (VM)

Features of Java n Java bytecodes are machine independent u This means that you can F compile Java source code on one platform F transfer the bytecodes to another platform and F execute them using a Java VM that has been ported for that platform u You can also send Java bytecodes around the Internet as data. Sending code around in this manner is called providing executable content

Running the Java Compiler (javac) and Interpreter (java) n On the CS dept. Solaris systems u the latest compiler, interpreter and class sources (J2SE) are in the directory /usr/j2se F the compiler and interpreter are in the /usr/j2se/bin directory. This should be included in your PATH u to run the compiler, just give the name of a.java file F % javac Hello.java u to run the interpreter, give the name of the bytecode file without the.class extension F % java Hello F Hello, World

Running the Java Compiler (javac) and Interpreter (java) n On Windows 9x/2000/NT u you can compile and run your programs using F the Java 2 Standard Development Kit (SDK) for Windows Latest I’ve tried is J2SEv1.3 available from Add the “bin” directory in your java directory to your DOS PATH Compile and run just like in Solaris F a commercial Java Interactive Development Environment (IDE) such Visual J++ ( CodeWarrior ( VisualCafe (