1 / 25

Java Chapter 1 – Java Introduction

Java Chapter 1 – Java Introduction. Basic computer concepts Different types of and programming languages Java SDK development environment Distributed and network computing Introduce OOP We will not cover UML in this class. What is a computer. A PC, mainframe, PDA

lcoughlan
Télécharger la présentation

Java Chapter 1 – Java Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java Chapter 1 – Java Introduction • Basic computer concepts • Different types of and programming languages • Java SDK development environment • Distributed and network computing • Introduce OOP • We will not cover UML in this class

  2. What is a computer • A PC, mainframe, PDA • A device that performs calculations • It must have Input, processing and output • PC computer organization • Input, Output, Memory, ALU, CPU, Secondary storage

  3. Parts of a computer • The microprocessor is a silicon chip designed to manipulate data. • Its speed is determined by: • Clock speed • Word size • Cache size

  4. Computer memory • Computer memory is a set of storage locations on the motherboard. There are four types of memory: • Random access memory (RAM) • Virtual memory • Read-only memory • Complementary metal oxide semiconductor memory (CMOS)

  5. Types of computers Personalcomputers are used for general computing tasks. Hand-heldcomputers fit in the palm of your hand and run on batteries. Mainframes are used by companies to provide centralized storage, processing, and management for large amounts of data. Supercomputers are the largest and fastest of computers, and can process an enormous volume of data.

  6. What is a computer • Parts

  7. How does a computer work? • Computer understand electronic pulses, High or low voltage, 1’s or 0’s. • We abstract these pulses as 1 and 0 and use binary to encode them. • Early computers did not have fancy I/O devices and did a lot of work in batch or off-line applications.

  8. How computers store data • Bytes can represent numbers in Binary • 00010000 = 16 • Or characters in ASCII • 01000001 = A • Storage and memory capacity is the amount of data the storage device can handle. • Kilobyte (KB) is about one thousand bytes • Megabyte (MB) is about one million bytes • Gigabyte (GB) is about one billion bytes

  9. Programming computers • Hard wired computers of the past… • At the machine level • Machine language binary codes to control the computer. • Simplified in Hexadecimal to store a byte of data. • ASCII encoding to represent characters • What a task…… • Programs on punch cards and tapes • Magnetic tapes • Disk…

  10. Role of the operating system • Early computers had very basic operating systems • They allowed for simple job scheduling. • Newer OS allow for multitasking, multiprocessing, virtual memory even GIU development • The OS provides programming layers to allow programs to run without direct interface with the hardware

  11. Software • The programs that run on the computer including the operating system. • Used to provide instructions. • First generation: machine language • Second generation: Assembler • Third generation: C/C++, Java, Cobol,… • Fourth generation: report generators, visual builders, code generators, query languages

  12. What about C/C++ • C++ evolved from C • C evolved from B used to create unix • Developed in 1967 • Java is derived from C/C++ syntax with differences

  13. What about Java • It is a fully OOP language. • With the exception of primitive data types • In C/C++ you can always go back to basic C • Java is a side-effect of a failed project by Sun to create a set top box called a star-7. • The Java then called oak was the language used to program the content for the box. • The box was kind of a canned internet package. • The internet browser killed its value, but java lived on. • Formally announced at Java on in 1995 (I was there)

  14. Why Java • A special niche in the internet for delivering application like web content called applets. • Animations and interactive user input where its big values. • Plus a programming model that was more sophisticated then HTML and JavaScript. • PS JavaScript and java are not related. • Netscape licensed the name for it scripting language from Sun (formerly known as livescript) • Both have similar syntax but do not be confused they are different.

  15. Why Java • Web Niche • Portability • Write once run(test) everywhere • Familiar syntax (like C/C++) • OOP • A rich API with built in GUI and networking C does not have built in. • Lots of marketing and hype

  16. What about other languages • There are more then we could count • Ansi C,Fortran, Pascal, Ada, Cobol, Abap • Basic Visual Basic, Visual C++, C# and .Net • Some are language and some are just IDE’s with libraries • Some are interpreted and some are compiled. • Some are procedural and some are object oriented

  17. Structured programming • Algorithms and syntax • The Systems Development Life Cycle (SDLC) • 1. Planning • 2. Analysis • 3. Design • 4. Implement • 5. Maintain

  18. What is OO • First what is procedural programming • Object oriented is a Programming language type. • Programming constructs are created in terms of classes • A class is a definition for a group of objects. • Like a blueprint or cookie cutter • Classes define an object behavior (method) and attributes (variables) • We will discuss this a lot more later

  19. Distributed computing • The internet • Web pages, HTML • Client Server computing • Client makes a request of the server over a network. • Client has user interface • Server has data • Client and/or server can have application logic • Examples: • Database server • File Servers • Web servers

  20. The Java environment • Visual Builder tools: • J++, Symantec, Jbuilder, Moca, Others. • The command line IDE tool from Sun • It has all of the power but no visual IDE

  21. Using Java SDK • Is interpreted and compiled. • Lets install the SDK 2.2 • From the CD • The SDK is a DOS command line tool • You will need to open a command window to use it. • Lets use notepad to write our Java application • Notepad Jtest.java • Lets compile it (creates Jtest.class) • Javac Jtest.java • Lets run it (this in the interpreter) • Java Jtest • Not that hard. Hu?

  22. DOS primer • Change current drive • a: • C: • Change directory • Cd \chapter1 • List files in a directory 8.3 names • Dir • Mkdir \chapter1 • To set the path to find the java programs you will need to execute this following command each time you open a Dos prompt window • path C:\J2SDK1.5.0_06\BIN;%path% • Type in javac to confirm the path is correct

  23. Hello program public class hello { public static void main( String args[] ) { System.out.println("Hello\n"); } } We will talk about this code. You will not understand it all now but more so later.

  24. Steps to create your program • 1. Edit • 2. Compile (javac hello.java) • 3. Load, verify, execute (java hello)

  25. Homework #1 • Download and install the J2SDK from www.javasoft.com • Complete any 2 of the programming exercises on page 35 numbered 6-10 • Be sure that the programs follow the required naming conventions and include comments.

More Related