Search Bar

Core Java Programming Introduction of Java Part 1.1


Core Java Programming Introduction of Java

Hello Programmers, 
Today we are going to learn basic introduction of Java Programming.  In today's blog, we cover half part of the chapter first in core java syllabus - Core Java Programming - Introduction of Java.

Syllabus Points:- 
     Introduction to Java, Features of Java, Comparison between C and C++, Difference between Procedure Oriented and Object Oriented,  Download and install JDK/JRE (Environment variables set up), The JDK Directory Structure, First Java Program through command prompt, First Java Program through Eclipse.

Core Java Programming Introduction of Java
Core Java Programming Introduction of Java

Introduction to Java:

Java is a High-Level programming language, originally developed by Sun-Microsystems and initiated by James Gosling and its team released in 1995. Java runs on a verity of platforms such as Windows, Mac OS, Linux, Unix etc.


James Gosling is the father of the JAVA programming language. Java is guaranteed to be “Write once, Run anywhere”. 
The language, initially called ‘Oak’ after an oak tree that stood outside Gosling's office, also went by the name ‘Green’ and ended up later being renamed as Java, from a list of random words.
The latest release of the Java Standard Edition is Java SE 11. With the advancement of Java and its widespread popularity, multiple configurations were built to suit various types of platforms. For example J2EE for Enterprise Applications, J2ME for Mobile Applications. 
The new J2 versions were renamed as Java SE (Standard Edition), Java EE (Enterprise Edition), and Java ME (Micro Edition) respectively.
It is owned by Oracle, and more than 3 billion devices run Java. Nowadays Java is under Development and Maintains by Oracle all the upcoming new release of Java is released by Oracle Software Company.
On 13 November 2006 Sun Microsystem released much of Java as Free and Open Source software under the term of GNU General Public License (GPL).
On 8 May 2007, Sun Microsystem finished the process of making all of Java core code free and open source.
The latest version is Java 11, released on September 25, 2018, which follows Java 10 after only six months, being in line with the new release schedule. Java 8 is still supported but there will be no more security updates for Java 9. Versions earlier than Java 8 are supported by companies on a commercial basis; e.g. by Oracle back to Java 6 as of October 2017 (while they still "highly recommend that you uninstall" pre-Java 8 from at least Windows computers).

Features to Java:


Object Oriented: In Java, everything is an Object. Java can be easily extended since it is based on the Object model. 

Platform Independent: Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform-independent bytecode. This bytecode is distributed over the web and interpreted by the Virtual Machine (JVM) on whichever platform it is being run on. 

Simple: Java is designed to be easy to learn. If you understand the basic concept of OOP Java, it would be easy to master. 

Secure: With Java's secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption. 

Architecture-neutral: Java compiler generates an architecture-neutral object file format, which makes the compiled code executable on many processors, with the presence of the Java runtime system. 

Portable: Being architecture-neutral and having no implementation dependent aspects of the specification makes Java portable. The compiler in Java is written in ANSI C with a clean portability boundary, which is a POSIX subset. 


Robust: Java makes an effort to eliminate error-prone situations by emphasizing mainly on compile-time error checking and runtime checking. 

Multithreaded: With Java's multithreaded feature it is possible to write programs that can perform many tasks simultaneously. This design feature allows the developers to construct interactive applications that can run smoothly. 

Interpreted: Java bytecode is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light-weight process. 

High Performance: With the use of Just-In-Time compilers, Java enables high performance. 

Distributed: Java is designed for the distributed environment of the internet. 

Dynamic: Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry an extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time.

System Requirements:

Operating System: Windows XP/7/8/8.1/10 or Linux or UNIX or Mac OS.

Software’s: JDK 8 or Higher (Latest one is 11), Notepad or Notepad ++ or Eclipse.

Hardware’s: Minimum 128MB RAM, Pentium 200-MHz Processor, 2GB Memory.


NOTE: In our course we mostly use Notepad, Professional recommended for learning any programming language we must use Notepad.

Comparison between C and C++:

C
C++
C was developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs.
C++ was developed by Bjarne Stroustrup in 1979 with C++'s predecessor "C with Classes".
When compared to C++, C is a subset of C++.
C++ is a superset of C. C++ can run most of C code while C cannot run C++ code.
C supports procedural programming paradigm for code development.
C++ supports both procedural and object-oriented programming paradigms; therefore C++ is also called a hybrid language.
C does not support object-oriented programming; therefore it has no support for polymorphism, encapsulation, and inheritance.
Being an object-oriented programming language C++ supports polymorphism, encapsulation, and inheritance.
In C (because it is a procedural programming language), data and functions are separate and free entities.
In C++ (when it is used as the object-oriented programming language), data and functions are encapsulated together in form of an object. For creating objects class provides a blueprint of the structure of the object.
In C, data are free entities and can be manipulated by outside code. This is because C does not support information hiding.
In C++, Encapsulation hides the data to ensure that data structures and operators are used as intended.
C, being procedural programming, it is a function-driven language.
While, C++, being object-oriented programming, it is an object driven language.
C does not support function and operator overloading.
C++ supports both function and operator overloading.
C does not allow functions to be defined inside structures.
In C++, functions can be used inside a structure.
C does not have namespace feature.
C++ uses NAMESPACE which avoids name collisions.
A namespace is a declarative region that provides scope to the identifiers (the names of types, functions, variables, etc) inside it. Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries. All identifiers at namespace scope are visible to one another without qualification. Identifiers outside the namespace can access the members by using the fully qualified name for each identifier.
C uses functions for input/output. For example scanf and printf.
C++ uses objects for input-output. For example cin and cout.
C does not support reference variables.
C++ supports reference variables.
C has no support for virtual and friend functions.
C++ supports virtual and friend functions.
C provides malloc() and calloc()functions for dynamic memory allocation, and free() for memory de-allocation.
C++ provides new operator for memory allocation and delete operator for memory de-allocation.
C does not provide direct support for error handling (also called exception handling)
C++ provides support for exception handling. Exceptions are used for "hard" errors that make the code incorrect.

Difference between Procedure Oriented and Object Oriented:


BASIS FOR COMPARISON
POP
OOP
Basic
Procedure/Structure-oriented.
Object-oriented.
Approach
Top-down.
Bottom-up.
Basis
The main focus is on "how to get the task done" i.e. on the procedure or structure of a program.
The main focus is on 'data security'. Hence, only objects are permitted to access the entities of a class.
Division
A large program is divided into units called functions.
The entire program is divided into objects.
Entity accessing mode
No access specifier observed.
Access specifier are "public", "private", "protected".
Overloading/ Polymorphism
Neither has it overloaded functions nor operators.
It overloads functions, constructors, and operators.
Inheritance
There is no provision of inheritance.
Inheritance achieved in three modes public private and protected.
Data hiding & security
There is no proper way of hiding the data, so data is insecure
Data is hidden in three modes public, private, and protected. Hence data security increases.
Data sharing
Global data is shared among the functions in the program.
Data is shared among the objects through the member functions.
Friend functions/classes
No concept of friend function.
Classes or function can become a friend of another class with the keyword "friend".
Note: "friend" keyword is used only in c++.
Virtual classes / function
No concept of virtual classes.
The concept of virtual function appears during inheritance.
Example
C, VB, FORTRAN, Pascal
C++, JAVA, VB.NET, C#.NET.

Post a Comment

0 Comments