Programi,Podaci,Varijable,Računanje- Uvod

Slides:



Advertisements
Similar presentations
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Advertisements

Software Engineering Implementation Lecture 3 ASPI8-4 Anders P. Ravn, Feb 2004.
Chapter 1: Computer Systems
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.
The Java Programming Language
Outline Java program structure Basic program elements
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Java: Chapter 1 Computer Systems Computer Programming II Aug
JAVA PROGRAMMING PART II.
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
University of Limerick1 Work with API’s. University of Limerick2 Learning OO programming u Learning a programming language can be broadly split into two.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Java: Chapter 1 Computer Systems Computer Programming II.
Java Language and SW Dev’t
General Features of Java Programming Language Variables and Data Types Operators Expressions Control Flow Statements.
System development with Java Lecture 2. Rina Errors A program can have three types of errors: Syntax and semantic errors – called.
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
CSC204 – Programming I Lecture 4 August 28, 2002.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
C Derived Languages C is the base upon which many build C++ conventions also influence others *SmallTalk is where most OOP comes Java and Javascript have.
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
Page: 1 การโปรแกรมเชิงวัตถุด้วยภาษา JAVA บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 15 มิถุนายน 2552 Keyword & Data Type มหาวิทยาลัยเนชั่น.
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.
SE-1010 Dr. Mark L. Hornick 1 Variables & Datatypes.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Java Language Basics By Keywords Keywords of Java are given below – abstract continue for new switch assert *** default goto * package.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
© 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.
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.
JAVA MULTIPLE CHOICE QUESTION.
Working with Java.
Chapter 4 Assignment Statement
Lecture 2: Data Types, Variables, Operators, and Expressions
Variables and Arithmetic Operators in JavaScript
University of Central Florida COP 3330 Object Oriented Programming
Chapter 3 Assignment Statement
Java Hello world !.
Starting JavaProgramming
null, true, and false are also reserved.
Arrays and strings -2 (nizovi i znakovni nizovi)
Introduction to Java Programming
Elementi programskog jezika PASCAL
Programi,Podaci,Varijable,Računanje - 1
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
An overview of Java, Data types and variables
Instructor: Alexander Stoytchev
Chapter 1: Computer Systems
Ključne reči,identifikatori, konstante i promenljive
Osnovni simboli jezika Pascal
Units with – James tedder
Units with – James tedder
JavaScript Reserved Words
Instructor: Alexander Stoytchev
Focus of the Course Object-Oriented Software Development
Module 2 - Part 1 Variables, Assignment, and Data Types
Instructor: Alexander Stoytchev
Zorah Fung University of Washington, Spring 2015
Chap 2. Identifiers, Keywords, and Types
Agenda Types and identifiers Practice Assignment Keywords in Java
Zorah Fung University of Washington, Winter 2016
Presentation transcript:

Programi,Podaci,Varijable,Računanje- Uvod Java Programi,Podaci,Varijable,Računanje- Uvod

Tokeni jedna od prvih faza prevođenja je skeniranje leksičkih elemenata tj. identifikacija tokena Token je primitivna jedinica koja ima sintaktično značenje if (i<100) sum+=i; Tokeni : if, ( , i , < , 100 , ) , sum , += , i , ; Ključne riječi : abstract, boolean, ..., while Specialni Tipovi Operatori : +, -, *, /, ..., >>> Delimiteri : , ; . ( ) [ ] Tokeni Identifier : sum, stk, ptr, ... Opći tipovi Literal : 12, 5.53, 5.97e24, 'c', "string" Java © - Eugen Mudnić

Skup znakova (Character set) Java jezik je napisan korištenjem skupa znakova Unicode (16-bit skup znakova) Prvih 256 znakova : Latin-1 Većina od prvih 128 znakova Latin-1 su ekvivalentni 7 bitnom ASCII skupu znakova Konverzija ASCII & Latin-1 <-> unicode obavlja se automatski Escape sekvence \uxxxx (x je heksadecimalno) Java © - Eugen Mudnić

Komentari Tri vrste komentara: /* text */ /** documentation */ // text Prevodilac ignorira sve od /* do */. /** documentation */ Ovo označava komentar za dokumentaciju. Prevodilac ignorira tu vrstu komentara. JDK javadoc alat koristi te komentare za automatsko kreiranje dokumentacije. // text Prevodilac ignorira sve od // do kraja tekuće linije Java © - Eugen Mudnić

Komentari Komentari mogu uključivati bilo koji valjani unicode znak Komentari se ne mogu gnijezditi ! /* zakomentiraj – nije još implementirano /* Radi nešto*/ Bicycle.changeGear(); */ Java © - Eugen Mudnić

Identifikatori Nazivi deklariranih entiteta (Varijable, konstante, nizovi, klase, metode, labele) Mora početi sa slovom, slijede slova, ili znamenke Ispravno : box1, _box, $box, money_box, moneyBox Neispravno : 1box, box!, #box, interface , money Box Java © - Eugen Mudnić

Identifikatori – što je slovo ? Skoro svaki znak napisan u svijetu Ispravno : cat, кошка , kokoš , zorba , ๔๗๚สฦล Oznaka valute $, £ , ... Spojna interpunkcija (“_”) Java © - Eugen Mudnić

Identifikatori Ne mogu se Java ključne riječi koristiti za identifikatore Ne mogu se nazivi predefiniranih konstanti koristiti kao identifikatori (true,false,...) Razlikovanje velika-mala slova (case significant) Dužina neograničena (ne zloupotrebljavati) Ne koristiti kriptične nazive (npr. Kvz78TG) Upotrebljavati konvencije za davanje baziva Koja je razlika između : topE topΕ ? Java © - Eugen Mudnić

Ključne riječi double int super boolean else interface switch abstract assert (java 1.4 !) double int super boolean else interface switch break extends long synchronized byte final native this case finally new throw catch float package throws char for private transient class* goto* protected try const if public void continue implements return volatile default import short while do instanceof static null, true i false su formalno literali ! goto i const se ne koriste ! Java © - Eugen Mudnić