Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
7 views

Unit1 Java Notes

This document provides an introduction to the Java programming language, highlighting its key features such as simplicity, object-orientation, platform independence, security, multithreading, and robustness. It also outlines the Java Development Environment, including the JDK, JRE, and IDEs, and explains the structure of a simple Java program, data types, variables, constants, literals, and various operators. Overall, it serves as a foundational guide for understanding Java programming.

Uploaded by

SAKSHAM AWASthi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Unit1 Java Notes

This document provides an introduction to the Java programming language, highlighting its key features such as simplicity, object-orientation, platform independence, security, multithreading, and robustness. It also outlines the Java Development Environment, including the JDK, JRE, and IDEs, and explains the structure of a simple Java program, data types, variables, constants, literals, and various operators. Overall, it serves as a foundational guide for understanding Java programming.

Uploaded by

SAKSHAM AWASthi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Unit 1: Introduction to Java

1. Overview of Java Programming Language


Java is a high-level, object-oriented programming language developed by Sun Microsystems
(now owned by Oracle). It is platform-independent, meaning that programs written in Java
can run on any device or operating system with a Java Runtime Environment (JRE).

2. Features of Java
- Simple: Java has a syntax similar to C, making it easier for new developers to learn.

- Object-Oriented: Everything in Java is treated as an object, following the principles of


object-oriented programming.

- Platform-Independent: Java programs can run on any platform that supports Java without
modification (Write Once, Run Anywhere).

- Secure: Java has built-in security features, such as bytecode verification and runtime
security management.

- Multithreaded: Java supports multithreaded programming, allowing multiple tasks to be


performed simultaneously.

- Robust: Java has strong memory management features and built-in error-handling
mechanisms.

3. Java Development Environment: JDK, JRE, and IDEs


- JDK (Java Development Kit): A software development kit that provides all the tools
required to develop Java applications, including the JRE, compiler, debugger, and other
utilities.

- JRE (Java Runtime Environment): A runtime environment that includes the Java Virtual
Machine (JVM), core libraries, and other resources needed to run Java applications.

- IDEs (Integrated Development Environments): Software that provides tools for writing,
debugging, and testing Java programs, such as Eclipse, IntelliJ IDEA, and NetBeans.

4. Writing and Running a Java Program (Hello World Program)


A simple Java program starts with a class definition. The main method, which is the entry
point of a Java program, contains the code to be executed.
Example: public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

5. Data Types and Variables


Java has two categories of data types: primitive types and reference types.

- Primitive types: int, float, char, boolean, etc.

- Reference types: Objects, arrays, and classes.

Variables are used to store data values. A variable must be declared with a specific data type
before it can be used.

6. Constants and Literals


- Constants: Variables whose values cannot be changed after initialization. Defined using
the final keyword.

Example: final int MAX_VALUE = 100;

- Literals: Fixed values assigned to variables, such as 10, 3.14, and "Hello".

7. Operators: Arithmetic, Relational, Logical, Bitwise


- Arithmetic Operators: +, -, *, /, % (addition, subtraction, multiplication, division, modulus)

- Relational Operators: ==, !=, >, <, >=, <= (comparison of values)

- Logical Operators: && (AND), || (OR), ! (NOT) (used for logical operations)

- Bitwise Operators: &, |, ^, ~, <<, >>, >>> (used to perform bit-level operations on integer
data types)

You might also like