****** 1.
Basic Syntactical constructs in Java ******
Introduction to Java:
Java is a High-Level Programming Language.
Java is a true object oriented language.
Java was Developed by James Gosling and Mike Sheridan in 1995.
Java is a platform-independent language. This means that Java code can run on any
platform that has a Java Virtual Machine (JVM).
It was developed in year 1991.
Initially, it was called as Oak (tree name)
It's name got changed to Java in year 1995.
Java has a huge community support (tens of millions of developers)
Features of Java Language:
1] Simple:
Java's syntax is easy to learn and understand.
It avoids complex concepts from other languages, like pointers and operator
overloading.
Emphasizes a clean and straightforward programming style.
2] Object-Oriented:
Everything in Java is treated as an "object" with data and behavior.
Core concepts include objects, classes, inheritance, polymorphism, abstraction, and
encapsulation.
Provides a flexible and extensible programming model.
BY LAXMIKANT MAHINDRAKAR (MAHINDRATECH COACHING) - +91 8767369115
3] Robust:
Focuses on catching errors during both compile time and runtime.
Improved memory management using a garbage collector.
Better handling of exceptions enhances program stability.
4] Platform Independent:
Java programs are compiled into bytecode, ensuring platform independence.
Bytecode can run on any machine with Java Runtime Environment (JRE) installed.
Adds an extra layer of security by running in a controlled environment.
5] Secure:
Java's design prioritizes security features.
Programs run in a secure environment with limited interaction with the operating
system.
Helps in developing virus-free systems.
6] Multi-Threading:
Supports multithreading, allowing the execution of multiple tasks simultaneously.
Efficiently utilizes shared resources, enhancing performance.
Enables smoother execution, such as checking for errors while typing.
7] Architectural Neutral:
Compiler generates bytecodes that are independent of computer architecture.
Java programs can be easily interpreted on any machine.
Enhances portability and adaptability across diverse platforms.
8] Portable:
Java bytecode can run on various platforms without modification.
Eliminates implementation-dependent features for consistent behavior.
Predefines storage-related aspects, such as the size of primitive data types.
9] High Performance:
Although interpreted, Java achieves high performance.
Utilizes a just-in-time compiler to enhance execution speed.
Balances performance and portability effectively.
10] Distributed:
Java is well-suited for developing programs that run on computer networks.
Offers a specialized class library for communication using TCP/IP protocols.
Simplifies the creation of network connections compared to languages like C/C++.
11] Dynamic:
Java is a dynamic language. It supports the dynamic loading of classes. It means
classes are loaded on demand. It also supports functions from its native languages,
i.e., C and C++.
Java supports dynamic compilation and automatic memory management (garbage
collection).
BY LAXMIKANT MAHINDRAKAR (MAHINDRATECH COACHING) - +91 8767369115
Difference between C++ and Java Language:
BY LAXMIKANT MAHINDRAKAR (MAHINDRATECH COACHING) - +91 8767369115
Q] Why Java is not called ‘Pure Object Oriented Language’?
->
Java is called ‘True Object Language’ but not ‘Pure Object Oriented Language’
because :
1] Primitive Data Types:
In Java, there are some basic types like int and double that are not treated as
objects.
In a pure object-oriented language, everything, including basic types, would
be objects.
2] Static Methods:
Java allows the creation of static methods that don't belong to any object.
In a pure object-oriented language, all methods would be associated with
objects.
3] Lack of Multiple Inheritance:
Java doesn't support multiple inheritance for classes (where a class can
inherit from more than one class).
In a pure object-oriented language, this feature would be allowed.
4] Primitive Casting:
Java allows type casting between primitive data types, which involves
converting one type to another.
In a pure object-oriented language, such conversions wouldn't exist, and
everything would be treated uniformly as objects.
BY LAXMIKANT MAHINDRAKAR (MAHINDRATECH COACHING) - +91 8767369115