Java

Topics: Programming language, Object-oriented programming, Computer program Pages: 9 (1218 words) Published: June 2, 2013
2/21/2013

SKJ2413 OBJECT ORIENTED PROGRAMMING
Chapter 1 2013

Mohd Fadzli Marhusin PhD (CompSc) UNSW (Cyber Security) Master (Info Tech) CompSc UKM BSc Info Studies (Info Systems Mgnt) UiTM American Associate Degree (Mgnt Info Systems) KYPM MCSE & MCTS Microsoft Faculty of Science and Technology (Information Security & Assurance Program) Universiti Sains Islam Malaysia Bandar Baru Nilai, 71800 Nilai, Negeri Sembilan, Malaysia fadzli@usim.edu.my +606 798 8000 ext 6663

1

Copyright Reserved. Mohd Fadzli Marhusin.

Computer Instruction
A computer program is a set of instruction that tell computer what to do. Computer Instruction is in the form of on and off switches. Often this is represented by a binary form of 1s and 0s. For instance: a = 97 = 1100001 b = 98 = 1100010 For additional examples please refer to http://www.asciitable.com/ & http://www.branah.com/ascii-converter.

Copyright Reserved. Mohd Fadzli Marhusin.

2

1

2/21/2013

Computer Instruction : Execution Flow
Any program you execute .e.g., a calculator, will be loaded first into RAM, then when the CPU is ready to execute, instructions will be transferred part by part from RAM into the CPU. The CPU is divided into Logic Unit – to deal with general execution (in and out) and Arithmetic Logic Unit – to deal with instruction related to mathematical calculation. The CPU also has a set of memory/cache hierarchy usually referred to as register, L1 and L2. From programmer point of view, the details of CPU architecture and the memory and how they work are not important as long as a program written execute well without any errors. .

Copyright Reserved. Mohd Fadzli Marhusin.

3

Computer Instruction : Cont’
You write a computer program using a high-level programming language, e.g. java. The java compiler and interpreter responsible to converting the code you write into form of on and off switches. When you execute a java program, the program is run within a contained environment called JAVA Runtime Environment (JRE).

Copyright Reserved. Mohd Fadzli Marhusin.

4

2

2/21/2013

Computer Instruction : Cont’
Advantage of using high-level programming languages: We do not have to deal with difficult memory (RAM) assignment and reassignment for those methods/functions and variables involved. Using high-level programming language we can use easy-toremember names for methods/functions and variables and etc.

Copyright Reserved. Mohd Fadzli Marhusin.

5

Compiler/Interpreter
Just like our own, any languages and programming languages have set of rules/grammar to follow otherwise computer will not understand and will not execute them. For a program written in any high-level programming languages (HLPL), it requires a process of translation from its present form into machine code or something close to that. For a translation to happen, a compiler and/or an interpreter are required.

Copyright Reserved. Mohd Fadzli Marhusin.

6

3

2/21/2013

Advantages & Disadvantages
What are the advantages/disadvantages of a compiler versus an interpreter? With a compiler, a compilation will not successful if there are syntax error, rending entire statements in a program being ignored (not executed). Logically if you fail to construct a proper sentence, others will find it difficult to understand your message. Faster execution. With an interpreter, good statements continue to execute until a bad statement triggers an error. Slower execution. C++ uses a compiler. VB uses an interpreter. Java uses both.

Copyright Reserved. Mohd Fadzli Marhusin.

7

Procedural vs. Object-oriented programming
Procedural programming commonly involves the use of variables and functions or also called methods. The execution of this program takes place by invoking a set of related functions and manipulating those variables involved. Object-oriented programming (OOP) take advantage of the same concept but extending those codes into classes of something...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Homework CH 1 Java Essay
  • PROBLEMS ENCOUNTERED BY COMPUTER SCIENCE STUDENTS IN JAVA PROGRAMMING Essay
  • Java Basics Book Essay
  • Programming in a Nutshell: from Assembly to Java Essay
  • JAVA Essay
  • Java Essay
  • Essay on the history of Java, which is a modern computer programming language.
  • Inroduction to Java Essay

Become a StudyMode Member

Sign Up - It's Free