14
ICT 6007 Visual and Internet Programming using JAVA Mohammad Tanvir Alam Lecturer IICT,BUET Home page: http://teacher.buet.ac.bd/teacher/mtanviralam/

ICT 6007 Visual and Internet Programming using JAVA

Embed Size (px)

DESCRIPTION

ICT 6007 Visual and Internet Programming using JAVA. Mohammad Tanvir Alam Lecturer IICT,BUET Home page: http://teacher.buet.ac.bd/teacher/mtanviralam/. Administrative. Contact [email protected] [email protected] Course Group www.groups.yahoo.com/group/ict6007 Course handout - PowerPoint PPT Presentation

Citation preview

Page 1: ICT 6007 Visual and Internet Programming using JAVA

ICT 6007Visual and Internet Programming

using JAVA

Mohammad Tanvir AlamLecturerIICT,BUETHome page: http://teacher.buet.ac.bd/teacher/mtanviralam/

Page 2: ICT 6007 Visual and Internet Programming using JAVA

Administrative

• Contact– [email protected][email protected]

• Course Group– www.groups.yahoo.com/group/ict6007

• Course handout– www.groups.yahoo.com/group/ict6007 Or – http://teacher.buet.ac.bd/teacher/mtanviralam/

• Please join the group to get lecture materials and participate in group discussion

• Feel free to e-mail me anytime

Page 3: ICT 6007 Visual and Internet Programming using JAVA

Reference

Book• Java How to Program (5th or 6th edition)

Deitel & Deitel• Programming Tools

– Java 2 Standard Edition

• IDE– JBuilder 7.0 or later

– Kawa 4.0 or later

Page 4: ICT 6007 Visual and Internet Programming using JAVA

Chapter 1

Outline

History of C++ History of Java Java Class Libraries BASIC, Visual Basic, Visual C++, C# and .NET Basics of a Typical Java Environment

Thinking about Objects

Page 5: ICT 6007 Visual and Internet Programming using JAVA

Machine Languages, Assembly Languages and High-Level

Languages

• Machine language– “Natural language” of computer component

– Machine dependent

• Assembly language– English-like abbreviations represent computer operations

– Translator programs convert to machine language

• High-level language– Allows for writing more “English-like” instructions

• Contains commonly used mathematical operations

Page 6: ICT 6007 Visual and Internet Programming using JAVA

Compiler VS Interpreter

• Compiler– Compiler convert to whole program to machine language

• Interpreter– Execute high-level language programs without compilation

line by line

Page 7: ICT 6007 Visual and Internet Programming using JAVA

History of C++

• C++– Evolved from C

– Provides object-oriented programming capabilities

• Objects– Reusable software components that model real-world items

Page 8: ICT 6007 Visual and Internet Programming using JAVA

History of Java

• Java– Originally for intelligent consumer-electronic devices

– Then used for creating Web pages with dynamic content

– Now also used for:• Develop large-scale enterprise applications

• Enhance WWW server functionality

• Provide applications for consumer devices (cell phones, etc.)

Page 9: ICT 6007 Visual and Internet Programming using JAVA

Java Class Libraries

• Classes– Include methods that perform tasks

– Used to build Java programs

• Java contains class libraries– Known as Java APIs (Application Programming Interfaces)

Page 10: ICT 6007 Visual and Internet Programming using JAVA

BASIC, Visual Basic, Visual C++, C# and .NET

• BASIC– Beginner’s All-Purpose Symbolic Instruction Code

• Visual Basic .NET– Framework Class Library (FLC)

• Visual C++– Microsoft Foundation Classes (MFC)

• C#– C-Sharp

• .NET– .NET platform

Page 11: ICT 6007 Visual and Internet Programming using JAVA

Basics of a Typical Java Environment

• Java programs normally undergo five phases– Edit

• Programmer writes program (and stores program on disk)

– Compile• Compiler creates bytecodes from program

– Load• Class loader stores bytecodes in memory

– Verify• Verifier ensures bytecodes do not violate security requirements

– Execute• Interpreter translates bytecodes into machine language

Page 12: ICT 6007 Visual and Internet Programming using JAVA

Fig. 1.1 Typical Java environment.

PrimaryMemory

.

.

.

.

.

.

Disk

Disk

Disk

Editor

Compiler

Class Loader

Program is created in an editor and stored on disk in a file ending with .java.

Compiler creates bytecodes and stores them on disk in a file ending with .class.

Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory.

Phase 1

Phase 2

Phase 3

PrimaryMemory

.

.

.

.

.

.

Bytecode Verifier Bytecode verifier

confirms that all bytecodes are valid and do not violate Java’s security restrictions.

Phase 4

PrimaryMemory

.

.

.

.

.

.

InterpreterInterpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes.

Phase 5

Page 13: ICT 6007 Visual and Internet Programming using JAVA

Thinking About Objects (cont.)

• Objects– Reusable software components that model real-world items

– Look all around you• People, animals, plants, cars, etc.

– Attributes• Size, shape, color, weight, etc.

– Behaviors• Babies cry, crawl, sleep, etc.

Page 14: ICT 6007 Visual and Internet Programming using JAVA

Thinking About Objects (cont.)

• Object-oriented design (OOD)– Models real-world objects

– Models communication among objects

– Encapsulates attributes and operations (behaviors)• Information hiding

• Communication through well-defined interfaces

• Object-oriented language– Programming in object oriented languages is called object-

oriented programming (OOP)

– Java