https://gcreddy.info/java-tutorial-for-beginners/
Java Environment Setup, Download & Install Java, Set Java Environment Variable, Download & Install Eclipse IDE, and Write & Run Java Programs.
Java Environment is required is to write and execute Java programs.
Java Language Syllabus
https://www.gcreddy.com/2021/06/java-programming-syllabus.html
1. Introduction to Java Programming
https://gcreddy.info/introduction-to-java-programming/
2. Java Environment Setup
https://gcreddy.info/java-environment-setup/
3. Java Keywords and Identifiers
https://gcreddy.info/java-keywords-and-identifiers/
4. Java Program Structure
https://gcreddy.info/java-program-structure/
5. Java Comments
https://gcreddy.info/java-comments/
6. Java Data Types
https://gcreddy.info/java-data-types/
7. Java Variables
https://gcreddy.info/java-variables/
8. Operators in Java
https://gcreddy.info/operators-in-java/
9. Java Control Flow Statements
https://gcreddy.info/java-control-flow-statements/
10. Java Strings
https://gcreddy.info/java-strings/
11. Arrays in Java
https://gcreddy.info/arrays-in-java/
12. Java ArrayList
https://gcreddy.info/java-arraylist/
13. Java Input and Output
https://gcreddy.info/java-input-and-output/
14. Java User Defined Methods
https://gcreddy.info/java-user-defined-methods/
15. Java Built-in Methods
https://gcreddy.info/java-built-in-methods/
16. Exception Handling in Java
https://gcreddy.info/exception-handling-in-java/
17. Java Object-Oriented Programming
https://gcreddy.info/java-object-oriented-programming/
Three important steps in Software Programming,
i. Write a Program (in an Editor)
ii. Compile the Program
iii. Run the program
A. Steps for writing and executing Java programs using the command-line interface
i. Download Java Software (JDK) and Install
ii. Set Java Environment variable in the OS Environment
iii. Write a Java program in Notepad and save it with the “.java” extension
iv. Compile the java program file in command prompt and Run…
B. Steps for writing and executing Java programs using Eclipse IDE
i. Download Java Software (JDK) and Install
ii. Set Java Environment variable in the OS Environment
iii. Download Eclipse IDE and Extract
iv. Write Java programs in Eclipse Editor and Run
Download Java Software (JDK) from either java.com or oracle.com, and install
Note: Download Java Software based on your Operating Environment
Ex: Windows 10 64 bit OS
After Java Software installation we get the “Java” Folder in C:/Program Files/
Set Java Environment Variable…
Copy JDK bin directory path from your computer,
Navigation to set Java Environment Variable:
• Select MyComuter and Right Click
• Properties
• Click “Advanced System Settings”
• Click “Environment Variables”
• Select “Path” Variable in the System Variables pane
• Click “Edit”
• Paste Jdk bin dierectory path
• Click “OK”
• Click “OK”
Steps to write & execute a Java Program
Step 1: Write a Program in Notepad
public class Sample{
public static void main (String [] args){
System.out.println(“Hello Java”);
}
}
save as .java file with the class name
Step 2: Compile the Program
• Launch the Command prompt
• Change to Java program file directory
• Type javac File Name/sample.java
* Then it will create a Java class file (.class)
Step 3: Run the program
• Launch the Command prompt
• Change to Java program file directory
• Type java and Class file name without extension
* It will display the output on the Console
Eclipse IDE:
• Eclipse IDE is an Open Source software
• It is a platform to write & execute Software programs like Java, C, C++, Perl, Python, Ruby, PHP, etc…
• It provides an Editor for writing Programs, Syntax Guidance, Context Help, and Auto compilation, etc…
Navigation for writing and executing Java programs in Eclipse IDE
• Launch Eclipse IDE
• Create Java project
• Create Java Package under the Java Project
• Create Java Class under the Java Package
• Write Java code in the Java Class…
Java Program Example: