[Go to site: main page, start]

0% found this document useful (0 votes)
53 views2 pages

Basic Java Notes-3

Java is a high-level, object-oriented programming language developed by Sun Microsystems, known for its platform independence and ability to run on any system via the Java Virtual Machine. Key features include being secure, robust, and multithreaded, with a structure that typically includes a class definition and a main() method. The document also covers basic data types, operators, control statements, and core object-oriented concepts such as classes, objects, encapsulation, inheritance, and polymorphism.

Uploaded by

sivarekha68
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

Basic Java Notes-3

Java is a high-level, object-oriented programming language developed by Sun Microsystems, known for its platform independence and ability to run on any system via the Java Virtual Machine. Key features include being secure, robust, and multithreaded, with a structure that typically includes a class definition and a main() method. The document also covers basic data types, operators, control statements, and core object-oriented concepts such as classes, objects, encapsulation, inheritance, and polymorphism.

Uploaded by

sivarekha68
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Basic Java Notes

1. Introduction to Java

• Java is a high-level, object-oriented programming language.

• It was developed by Sun Microsystems and later acquired by Oracle.

• Java programs can run on any system using the Java Virtual Machine (JVM).

• Java follows the principle: Write Once, Run Anywhere.

2. Features of Java

• Platform Independent

• Object Oriented

• Secure

• Robust

• Multithreaded

• Portable

3. Structure of a Java Program

• A Java program usually contains a class definition.

• The main() method is the entry point of the program.

• Syntax example: public static void main(String[] args)

4. Basic Java Program Example

• public class HelloWorld {

• public static void main(String[] args) {

• [Link]("Hello World");

• }

• }

5. Data Types in Java

• int – integer numbers


• float – decimal numbers

• double – large decimal numbers

• char – single character

• boolean – true or false

• String – sequence of characters

6. Operators in Java

• Arithmetic Operators: +, -, *, /, %

• Relational Operators: ==, !=, >, <, >=, <=

• Logical Operators: &&, ||, !

7. Control Statements

• if statement

• if-else statement

• switch statement

• for loop

• while loop

• do-while loop

8. Object Oriented Concepts

• Class – blueprint for objects

• Object – instance of a class

• Encapsulation – wrapping data and methods together

• Inheritance – acquiring properties of another class

• Polymorphism – one method with different behaviors

You might also like