https://www.gcreddy.com/2021/05/an-overview-of-java-programming.html
Introduction to Java Programming, an overview of Java, Java Programming Environment setup, Java Language Fundamentals, and Java Object-oriented Programming.
1. Java Installation and Programming Environment Setup
Download Java (JDK) software and install, set Java environment variable, No built-in editor in Java for writing programs, so Download & Extract/Install Eclipse IDE, Launch Eclipse IDE, and start writing Java Programs.
2. Java Keywords and Identifiers
Java keywords are also known as reserved words. Keywords are particular words that act as a key to a code. These are predefined words by Java so they cannot be used as identifiers.
Identifiers in Java are symbolic names used for identification. They can be a class name, variable name, method name, package name, constant name, and more.
3. Java Syntax
Every programming language has its own syntax, we have to write programs using the syntax.
Example:
i. Java is case sensitive language
ii. Java code blocks should be enclosed with {}
iii. Every Java statement should end with a semi-colon.
Etc,
4. Java Program Structure
When we are writing any program in any language we need to follow a standard structure. Java has a specific structure to write programs.
Generally, a standard Java program consists of some sections.
i. Documentation section
ii. Package Declaration
iii. Import Statements
iv. Interface Section
v. Class Definition
vi. Class Variables and Variables
vii. Main Method Class
viii. Methods and Behaviors
5. Java Comments
Comments are English words used for Code Documentation
Purpose of Comments:
To make the Code Readable
To make the code prevent from Execution
Note: Java Supports single-line comments and multiple-line comments.
Syntax:
i. Use // for Single line Syntax
ii. Use /*……………….*/ for multiline comment
6. Java Data Types
A Data type is a classification of the type of data that a variable or object can hold in Computer programming
Examples:
Character,
Integer,
Float, Double….
String
Boolean etc…
Java supports two categories of Data Types,
i. Primitive Data Types
ii. Non-Primitive Data Types / Reference Data Types
7. Java Variables
A named memory location to store or hold temporary data within a program
(RAM
ROM – HDD, CD, DVD, USB Drive, etc…)
Java Supports three types of variables,
i. Local Variables
ii. Instance Variables
iii. Static Variables/Class Variables
8. Java Operators
Operators are used to performing Mathematical, Comparison, and Logical operations
Categories of Operators in Java:
i. Arithmetic Operators
ii. Assignment Operators
iii. Relational / Comparison Operators
iv. Logical Operators
v. Bitwise Operators
vi. Miscellaneous Operators
etc…
9. Java Control Flow - Decision Making/Conditional Statements
i. Two Types of Conditional Statements
a. if statement
b. switch statement
10. Java Control Flow - Loop Java Loop Statements
Loop Statements are used for code repetitive execution
Four types of loop statement in Java,
i. for loop
ii. while loop
iii. do while loop
iv. enhanced for loop (Array)
11. Java Control Flow - Branching Statements
• Branching statements are used to transfer control from one point to another in the code
• Branching statements are defined by three keywords – break, continue and return
12. Java Strings
• String is a sequence of characters written in “”
• String may contain Alphabytes, Numeric, Alpha-numeric, and special characters.
13. Java Arrays
• Array is a collection of similar type of elements
• In Java Array is an Object that contains elements of similar data types
• Java Array is index bases and index starts from zero
• The length of an Array is established when they are is created and Array length is fixed,
• Each item in an Array is called as an Element
14. Java ArrayList
• Java Array is Static Data Structure and ArrayList is Dynamic Data Structure.
• The ArrayList class is a resizable array, which can be found in java.util package.
• The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified. While elements can be added and removed from an ArrayList whenever you want.
15. Java User Input
The Scanner class is used to get user input, and it is found in java.util package.
To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation.
16. Java File Handling
18. Java Methods
What is Method?
Java Method is a block of code /set of statements/steps that are grouped together to perform certain actions.
Advantages of Methods
i. Code reusability, so that we can reduce the code size
ii. Code maintenance is easy
19. Java Exception Handling
An exception is an event that occurs during the execution of a program when the normal execution of the program is interrupted.
Exception handling is a mechanism to handle run-time errors.