“Introduction to Programming With Java”

Slides:



Advertisements
Similar presentations
Introduction to programming in java. Input and output to screen with Java program Structure of Java programs Statements Conditional statements.
Advertisements

Begin Java Pepper. Objectives What is a program? Learn the basics of your programming tool: BlueJ Write a first Java program and see it run Make some.
JAVA BASICS SYNTAX, ERRORS, AND DEBUGGING. GCOC – A.P. Computer Science A College Board Computer Science A Topics Covered Program Design - Read and understand.
Chapter 2: Your First Program! Hello World: Let’s Program  All programs must have the extension.java  Our first program will be named: HelloWorld.java.
How do we make our Welcome.java program do something? The java in our Welcome.java file won’t do anything by itself. We need to tell the computer to execute.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
CHAPTER 1 INTRODUCTION GOALS  To understand the activity of programming  To learn about the architecture of computers  To learn about machine code and.
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,
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Copyright 2006 by Pearson Education 1 Building Java Programs Chapter 1: Introduction to Java Programming.
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
1 Building Java Programs Chapter 1: Introduction to Java Programming These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They may.
Laboratory Study October, The very first example, traditional "Hello World!" program: public class first { public static void main (String[ ]
C# B 1 CSC 298 Writing a C# application. C# B 2 A first C# application // Display Hello, world on the screen public class HelloWorld { public static void.
CS107 Introduction to Computer Science Java Basics.
Introduction to Computational Linguistics Programming I.
Welcome to the Lecture Series on “Introduction to Programming With Java”
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
Introduction to Computers and Java Chapter 1.3. A Sip of Java: Outline History of the Java Language Applets A First Java Program Compiling a Java Program.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
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.
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
“Introduction to Programming With Java”
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Output in Java Hello World!. Structure of a Java Program  All Java files in ICS3U1 have the following structure: class HelloWorld { }  Notice the open.
8/31: Intro to Java, Languages, and Environments Types of programming languages –machine languages –assembly languages –high-level languages Java environment.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Creating Your First Computer Program in Java Margaret Yau.
Pre-Sessional Java Programming Lecture 1a Reyer Zwiggelaar
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
Hello Computer Science!. Below is an example of a Hello World program in JAVA. While it is only three lines of code, there are many things that are happening.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
Lab 01-2 Objectives:  Writing a Java program.  How to send output to the command line console.  Learn about escape sequences.  Learn how to compile,
CSI 3125, Preliminaries, page 1 Compiling the Program.
CSc 201 Introduction to Java George Wells Room 007, Hamilton Building
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Java FilesOops - Mistake Java lingoSyntax
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
CS 106 Introduction to Computer Science I 01 / 24 / 2007 Instructor: Michael Eckmann.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Chapter 3 Introducing Java. Objectives and Goals 1. Define terminology associated with object- oriented programming. 2. Explain why Java is a widely used.
Introduction to Programming (CS 201) Lecture 01 - Introduction.
Copyright 2010 by Pearson Education APCS Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Introduction to java (class and object). Programming languages: –Easier to understand than CPU instructions –Needs to be translated for the CPU to understand.
Introduction to programming in java
Computer Programming Your First Java Program: HelloWorld.java.
Chapter 1 – Introduction
John Woodward A Simple Program – Hello world
GC101 Introduction to computer and program
Chapter 3 GC 101 Java Fundamentals.
CSE 190D, Winter 2013 Building Java Programs Chapter 1
Intro to Java.
Writing Methods.
An Introduction to Java – Part I, language basics
Java Tutotrial for [NLP-AI] 2
Java Intro.
CS110D Programming Language I
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
CSE 142, Spring 2012 Building Java Programs Chapter 1
CSE 142, Winter 2014 Building Java Programs Chapter 1
How to Run a Java Program
Presentation transcript:

“Introduction to Programming With Java”

Structure of Java programs Input and output to screen with Java program Statements Conditional statements Loop constructs Arrays, character and string handling Functions (if time permits)

1.Java 2: The Complete Reference – Patrick Naughton, Herbert Schildt 2.Thinking in Java ( – Bruce Eckel 3. Richard G Baldwin’s “Introductory Java Programming Tutorial” on:

Structure of Java programs Compiling and running the program Printing messages to the screen

Q. What is a program? Ans. A sequence of instructions that a computer can interpret and execute. Q. Why Java and not Hindi / Marathi / English? Ans. Since, so far, computer is not intelligent enough to understand natural languages.

class class-name { public static void main(String args[]) { statement1; statement2; … }

“First.java” class First { public static void main(String args[]) { System.out.println(“Hello World”); }

Compiling: is the process of translating source code written in a particular programming language into computer-readable machine code that can be executed. $ javac First.java This command will produce a file ‘First.class’, which is used for running the program with the command ‘java’. Running: is the process of executing program on a computer. $ java First

1.System.out.println(“Hello World”); – outputs the string “Hello World” followed by a new line on the screen. 2.System.out.print(“Hello World”); - outputs the string “Hello World” on the screen. This string is not followed by a new line. 3.Some Escape Sequence – \n – stands for new line character \t – stands for tab character

Some common errors in the initial phase of learning programming: - Mismatch of parentheses - Missing ‘;’ at the end of statement - Case sensitivity The best way to learn programming is writing a lot of programs on your own.

1.Write a program which prints the following information about at least 5 persons: NAME MAIL-ID EMPLOYEE-CODE PHONE Eg. Umesh p03161 Salil p03160 Each entry should be on a separate line. 2.Write a program that prints the following line on the screen along with quotes. “Can we print ‘\’ with System.out.println() statement?”

Thank you…