Lesson6 Java Programming
Lesson6 Java Programming
Lesson6 Java Programming
Programming
INTRODUCTION TO
PROGRAMMING USING
JAVA
STAGES IN DEVELOPING A COMPUTER PROGRAM
To better understand and analyze the problem we must conduct a study to the nature of the
problem and we must be able to define what are the necessary outputs required of the
program.
2.)Designing a solution to the problem
Breakdown the problem into several steps so that it is easier for us to solve the problem in smaller
pieces.
Algorithm
Flowcharting
PROGRAM
- A list of instructions written in a programming language that a computer can execute so that the
machine acts in a predetermined way.
TYPES OF PROGRAMMING STATEMENTS
1. Comments - Are statements that have no effect on the program, they are inserted at the key points
in the program and serve as an internal documentation of the program.
3. Input/output statements - Transfer data to and from the primary storage for use by the program, as
well as to and from other I/O devices like the monitor and the keyboard.
System.out.println(); or
System.out.print(); or
System.out.printf();
4.) COMPILING, DEBUGGING AND TESTING THE PROGRAM
COMPILER
DEBUGGING
TESTING
PROGRAMMING LANGUAGE
SYNTAX ERRORS – Errors due to the fact that the syntax of the language is not respected
SEMANTIC ERRORS – Errors due to an improper use of program statements
LOGICAL ERRORS – Errors due to the fact that the specification is not respected
RUNTIME ERRORS – Error that cannot be detected by the compiler
TYPES OF PROGRAMMING ERRORS
History of Java
1991
James Gosling
Developed by Sun Microsystem Inc.
Open source
FEATURES OF JAVA
1. Java is simple
2. Java is object-oriented
3. Java is interpreted
4. Java is portable
5. Java is secure
Basic Syntax:
Case Sensitivity - Java is case sensitive, which means identifier Hello and hello would have
different meaning in Java.
Class Names - For all class names the first letter should be in Upper Case.
Example:
CONSTANT VARIABLES