Units with – James tedder

Slides:



Advertisements
Similar presentations
Chapter 1: Computer Systems
Advertisements

Programming Languages
Programming with Java. Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: –Understand the.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
1 Kursusform  13 uger med: Undervisning i klassen 1,5-2 timer Opgave ”regning” i databar (løsninger på hjemmeside) En midtvejsopgave der afleveres og.
The Java Programming Language
Outline Java program structure Basic program elements
Chapter 1 Introduction. © 2004 Pearson Addison-Wesley. All rights reserved1-2 Outline Computer Processing Hardware Components Networks The Java Programming.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Chapter 1 Introduction.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Java: Chapter 1 Computer Systems Computer Programming II Aug
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
Chapter 1 Programming Languages. Application Development: Top 10 Programming Languages to Keep You Employed 1. Java 2. C# 3. C++ 4. JavaScript 5. Visual.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley John Lewis, Peter DePasquale, and Joseph Chase Chapter 1: Introduction.
© 2006 Pearson Education Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition.
Java: Chapter 1 Computer Systems Computer Programming II.
Java Language and SW Dev’t
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
The Java Programming Language
Introduction. Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Chapter 2: Java Fundamentals
Chapter 1: Introduction Java Programming Language How the Java Virtual Machine Works (compiling, etc…) Update by: Dan Fleck Coming up: The Java Programming.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Lecture 2 Software Concepts Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
1 Problem Solving b The purpose of writing a program is to solve a problem b The general steps in problem solving are: Understand the problemUnderstand.
Intro to Programming  Chapter 1 Part 2  Problem Solving.
Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.
Java.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Copyright 2010 by Pearson Education APCS Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Object Oriented Programming in
JAVA MULTIPLE CHOICE QUESTION.
Working with Java.
GC101 Introduction to computer and program
Chapter No. : 1 Introduction to Java.
Lecture 2: Data Types, Variables, Operators, and Expressions
CSE 190D, Winter 2013 Building Java Programs Chapter 1
Variables and Arithmetic Operators in JavaScript
University of Central Florida COP 3330 Object Oriented Programming
1.3 Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: Understand the problem Dissect the.
Unit 41 – Programing in Java
Statements, Comments & Simple Arithmetic
Starting JavaProgramming
null, true, and false are also reserved.
Introduction to Java Programming
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
An overview of Java, Data types and variables
Instructor: Alexander Stoytchev
Chapter 1: Computer Systems
Units with – James tedder
JavaScript Reserved Words
Instructor: Alexander Stoytchev
Java Software Solutions Foundations of Program Design 9th Edition
Focus of the Course Object-Oriented Software Development
Module 2 - Part 1 Variables, Assignment, and Data Types
(Computer fundamental Lab)
CSE 142, Spring 2012 Building Java Programs Chapter 1
Instructor: Alexander Stoytchev
Chap 2. Identifiers, Keywords, and Types
Presentation transcript:

Units with – James tedder Unit 41: Programming in Java Unit 27: Network Operating Systems Unit 46: Network Security Jamestedder.net james.tedder@NWHC.ac.uk

Unit 41 -Programming in Java Week 1

Unit Aim To provide you with an understanding of: The principles of programming in Java Explore the object oriented nature of the language and the multi- platform versatility offered.

Assignments Assignment 1 Produce training materials discussing the principles, characteristics and features of programming in Java You will critically evaluate the environmental flexibility of programming in Java. Assignment 2 Design, implement, test and document a Java program.

Welcome to Java! Java is Platform Independent, which means that you only need to write the program once to be able to run it on a number of different platforms! Java is portable, robust, and dynamic, with the ability to fit the needs of virtually any type of application. Java guarantees that you'll be able to Write Once, Run Anywhere.

Welcome to Java! Cont. More than 3 billion devices run Java. Java is used to develop apps for Google's Android OS, various Desktop Applications, such as media players, antivirus programs, Web Applications, Enterprise Applications (i.e. banking), and many more!

Java History Invented by James Gosling for Sun Microsystems First developed in 1990 Originally called Oak, renamed in 1994 Became freely available in 1995 Currently owned by Oracle. 

Advantages of the java platform Easy to learn.  Object-oriented.  Platform-independent.  Distributed. Secure. Robust. Multithreaded Distributed: Software that executes on two or more computers in a network. In a client-server environment, distributed applications have two parts: (1) the 'front end' that requires minimal computer resources and runs on the client computer(s), and (2) the 'back end' that requires large amounts of data crunching power and/or specialized hardware, and runs on a suitably equipped server computer. Read more: http://www.businessdictionary.com/definition/distributed-application.html Robust: Copes with errors well. Multi threaded: Can do lot’s of this at once.

Disadvantages of the java platform Performance: Java is comparatively slower and takes more memory space than the other native programming languages like C and C++.

Netbeans Integrated development environment for Java

Complete handout sheet 1 - Exercise 1 – Hello World Exercises Complete handout sheet 1 - Exercise 1 – Hello World

Syntax & standards

Java Program Structure In the Java programming language: A program is made up of one or more classes A class contains one or more methods A method contains program statements A Java application always contains a method called main main is the first method called when a Java application starts

Java Program Structure // comments about the class public class MyProgram { } class header class body Comments can be placed almost anywhere

Java Program Structure // comments about the class public class MyProgram { } // comments about the method public static void main (String[] args) { } method header method body

public static void main(String args[]) The method can be called from outside it’s class. Necessary because this method is being called by the Java runtime system which is not located in your current class. static Access modifier means we can call this method directly using class name without creating an object of it void Means the method does not return a value Java is platform independent language and if it will return some value then the value may mean different things to different platforms. main Name of the method. This name is fixed and as it's called by the JVM it’s the entry point for an application. String args[] These are the arguments of type String that your Java application accepts when you run it.

Identifiers Identifiers are the words a programmer uses in a program (variable names, class names, method names…) An identifier can be made up of letters, digits, the underscore character ( _ ), and the dollar sign Identifiers cannot begin with a digit Java is case sensitive - Total, total, and TOTAL are different identifiers By convention, programmers use different case styles for different types of identifiers, such as title case for class names - Lincoln upper case for constants - MAXIMUM

Reserved Words are predefined in the language, and cannot be used as identifiers The Java reserved words: abstract assert boolean break byte case catch char class const continue default do double else enum extends false final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true try void volatile while

What value prints? public void test() { int myVar = 10; int MYVAR = 20; myVar = 35; System.out.println(“Value is:”+MYVAR); } A. 10 B. 20 C. 35 D. MYVAR

White Space Spaces, blank lines, and tabs are called white space White space is used to separate words and symbols in a program Extra white space is ignored in Java A valid Java program can be formatted many ways Programs should be formatted to enhance readability, using consistent indentation

Complete handout sheet 1 – Section 6 Exercises a, b and c.