Nothing Special   »   [go: up one dir, main page]

Creating Java Programs

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Creating Java Programs

Topics covered

• Programming Terminology
• Comparing Procedural and Object-Oriented
Programming Concept
• Features of Java Programming Language
• Programming Methodologies
Topics covered

• Compiling Java Class and Correcting Syntax


Error
• Running Java Application and Correcting Logic
Errors
• Adding Comments to a Java Class
Programming Terminology
Assembly language:
• developed to make the programmer’s job
easier
• instruction is an easy-to-remember form called
a mnemonic
Assembler:
• A program that translates a program written in
assembly language into an equivalent program
in machine language.
Examples of Instructions in Assembly Language and
Machine Language
High-level programming language:
• close to spoken languages.
• instructions are much easier to understand
and is self-explanatory
Compiler:
• A program that translates a program written in
a high-level language into the equivalent
machine language.
Source program:
• A program written in a high-level language
Text editor:
• Used to create a program following the rules,
or syntax, of the language
IDE:
• contains many programs that are useful in
creating your program.
Interpreter:
• A program that reads and translates each
bytecode instruction into your computer’s
machine language, and then executes it.
Algorithm:
• A step-by-step problem-solving process in
which a solution is arrived at in a finite amount
of time.
Computer program:
• is a sequence of statements intended to
accomplish a task.
Programming:
• is a process of planning and creating a
program.
Programming language:
• A set of rules, symbols, and special words used
to construct programs.
Comparing Procedural and
Object-Oriented Programming
Concept
Procedural programming:
• program is divided into small parts called functions
• follows top down approach.
• no access specifier in procedural programming.
• function is more important than data.
• Examples: C, FORTRAN, Pascal, Basic etc.
Object Oriented Programming:
• program is divided into small parts called objects.
• follows bottom up approach.
• have access specifiers like private, public, protected etc.
• data is more important than function.
• Examples: C++, Java, Python, C# etc.
Features of Java Programming
Language
• Object Oriented
• Platform Independent
• Simple
• Secure
• Architecture-neutral
• Portable
• Robust
• Multithreaded
• Interpreted
• High Performance
• Distributed
• Dynamic
Programming Methodologies
Two popular approaches to programming design are the
structured approach and the object-oriented approach.

Structured Programming:
• Dividing a problem into smaller subproblems
• Each subproblem is then analyzed, and a solution for
the subproblem is obtained.
• The solutions to all the subproblems are then
combined to solve the overall problem.
• The structured design approach is also known as top-
down design, bottom-up design, stepwise refinement,
and modular programming.
Object-Oriented Programming
• Object-oriented design (OOD) is a widely used
programming methodology.
• In OOD, the first step in the problem-solving process is to
identify the components called objects, which form the
basis of the solution, and to determine how these objects
interact with one another.
Compiling Java Class and
Correcting Syntax Error
Running Java Application and
Correcting Logic Errors
Adding Comments to a Java
Class
Single-line comments:
• begin with // and can be placed anywhere in the line.
Everythingencountered in that line after // is ignored by
the compiler.
Multiple-line comments:
• are enclosed between /* and */. The compiler ignores
anything that appears between /* and */.

You might also like