Course overview was given in this lecture, is available in README.md.
Some learning resources are suggested in this lecture, is available in README.md
Java is a popular object-oriented programming language, created in 1995. Now, it is owned by Oracle, originally developed by Sun Microsystems. More than 3 billion devices run with Java. It allows developers to write code that can run on various platforms. It is a popular choice for building applications ranging from web and mobile to enterprise software.
- Mobile Applications (specially Android apps)
- Desktop Applications
- Web Applications
- Web Servers and Application Servers
- Games
- Database connection and much more.
- Platform independence (Write Once, Run Anywhere)
- Object-oriented programming
- Strongly typed language
- Automatic memory management (Garbage Collection)
- Rich standard library
- Multithreading and concurrency support
- Exception handling
- Security features (sandboxing)
- Dynamic class loading
- Robustness and error-checking at compile and runtime.
- Information processed like bytecode.
- Contain its all previous version.
- Works on different platforms
- Most popular
- Large demand in the current job market
- Easy to learn and simple to use
- Open source and free
- Secured, fast and powerful
- Huge community support
- It is an OOP language which gives a clear structure to program and allows code to be reused, lowering development costs.
- Close to C++ and C# and makes easy to switch from other programming languages.
class <Class Name> {
public static void main(String[] args) {
/* Write your code here */
}
}
Code for printing Hello, naztech
using Java in default package:
class MainProgram {
public static void main(String[] args) {
System.out.println("Hello, naztech");
}
}
Note: Write any class, package, variable or defining any others identifiers, always should be followed by naming conventions of that programming language. According to convention of java, class name should be title case, package should be lowercase and and variable should be camelcase.
JVM (Java Virtual Machine): JVM is the runtime engine that executes Java bytecode, ensuring platform independence. It interprets or compiles bytecode into native machine code for execution, handling memory and threads.
JRE (Java Runtime Environment): JRE includes the JVM, libraries, and other runtime components required to run Java applications. It's sufficient for running Java programs but doesn't include development tools.
JDK (Java Development Kit): JDK is a comprehensive package containing the JRE, development tools, and libraries necessary for creating Java applications. It includes a compiler, debugger, and other utilities for coding, testing, and deploying Java programs. JDK is essential for both development and running Java applications.
Syntax = Structure and format of code. Semantics = Meaning and behavior of code.
All java classes, variables must be identified with unique names. These unique names are called identifiers. It is recommended to use descriptive names in order to create understandable and maintainable code
There are about 54 reserved words in Java. Click here for details.
Key features of the Java programming language:
- Platform Independence: Java is designed to be platform-independent, meaning that a Java program can run on any operating system with a compatible Java Virtual Machine (JVM).
- Object-Oriented: Java follows the object-oriented programming (OOP) paradigm, allowing developers to model real-world entities as objects and create reusable and modular code.
- Simple and Easy to Learn: Java has a clean and straightforward syntax, making it relatively easy for beginners to grasp the language's concepts.
- Automatic Memory Management: Java manages memory automatically through its built-in garbage collection system, reducing the chances of memory leaks and providing memory efficiency.
- Strongly Typed: Java enforces strong type-checking during both compile-time and runtime, enhancing program reliability and reducing errors.
- Platform-Independent Libraries: Java comes with a vast standard library that provides pre-built classes and methods for various tasks, saving developers time and effort.
- Multithreading: Java supports multithreading, enabling the creation of programs that can execute multiple tasks concurrently, improving efficiency and responsiveness.
- Exception Handling: Java has a robust exception handling mechanism that helps manage and recover from runtime errors, ensuring stable and predictable program behavior.
- Security: Java has built-in security features, including a security manager and sandbox environment, making it suitable for developing secure applications, especially in web and network environments.
- Rich API: Java offers a wide range of APIs (Application Programming Interfaces) for tasks such as I/O, networking, databases, GUI development, and more.
- Distributed Computing: Java supports network programming and communication through its rich libraries, making it ideal for building distributed and networked applications.
- Dynamic Loading: Java allows classes to be loaded dynamically, which facilitates more flexible and adaptable program structures.
- Open Source Community: Java has a vibrant open-source community that contributes to the development of various libraries, frameworks, and tools.
- Portability: Java's "Write Once, Run Anywhere" philosophy ensures that code written in Java can be compiled once and executed on multiple platforms without modification.
- Continuous Evolution: Java continues to evolve with regular updates and new features, ensuring that it remains relevant and competitive in the modern programming landscape.
- Go to >> https://spring.io/tools.
- Go to >>
Spring Tools 4 for Eclipse
section. - Choose
4.19.1 - Windows x86_64
to download or other option based on your OS. - Extracting Spring Tools
- Run 'Hello World' using Spring Tools
Note: If you have any further confusion, follow some youtube video or read some blog post.
- Learn history of JAVA.
- Write a JAVA program "Hello World" in notepad and execute with command line.