Using Java with Enterprise Internet Computing | Java Tutorial For Beginners Part-3 | Intellipaat

Knowledge Lighthouse
57 followers
Oct 26, 2022
Hello everyone, as it is known to the masses that java is one of the most popular programming languages
and an object-oriented third generation language that is extensively used in
application development for multiple platforms such as desktop programs, navigation systems,
mobile applications, monitoring devices or computers and so on. Java developers are
constantly in demand. Java continues to be the most popular programming language despite
its growing competition among other languages. Hence, it is believed that the future of java
is quite bright and that being said I welcome you all to this third session on java programming
framework. The concepts that we will be touching upon throughout the session are what is java
followed by an object-oriented approach. Then we'll be having a discussion upon platform
independence and at the end using java with enterprise internet computing. But before we
do that make sure you hit that subscribe button and bell icon so that you never miss any update
from Intellipaat YouTube channel. Hello everyone, the key benefits as it is a programming language
we say these are the different terminology you may hear from object-oriented, it is
interpreter platform independent language, it is dynamic and distributed, it provides multi-threading
concepts, implements robustness and the security level of an application. Let us talk about each
right. So let me tell you in perspective with C++ how you were writing the code with it.
In C++ we used to write a code implementing object-oriented nature but that is not
fully platform independent language. If I am writing my code with C++ compilation
is converting my code into machine specific language or rather we call it as binary language.
The moment it gets converted to binary you are bound to the platform operating system
on which your program is developed. So that is one way why C++ was providing a drawback of
platform independence which has been overcome with java that is very major drawback of C++.
Second when I say it is object-oriented but you have marked that wherever we are executing the
code of a C++ it was through the main method which was an entity outside the class definition
right. So all the time you need to create an object, allocate the memory, do your stuff of
calling the functions and all the business logic and then deallocate memory right. That means it is
not purely object-oriented language because it was executing the code outside the class definition
okay. So it is not much encapsulated as it has to be. The strongly encapsulated
at its need to be. Let's talk about C++. Do we have C++ programming language
used to develop any application which may be accessed via any portable device.
When I say any portable device it may be my desktop, it may be my tablet, it can be my smartphone,
it can be my palmtop. Do we have a C++ which helps you to write a code which is dynamic,
which depends on its executing environment to support the different operating system.
When I say it is my smartphone what operating system it uses android. Does your C++ provides
a library to support android operating system? Not exactly right. So java provides you a dynamic
nature. Whenever required my one application can execute on a different platform plus on a
different environment as well okay. When I say it is on a different environment what does it mean?
The different environment which is runtime environment required by my any programming
okay. Java also provides you the distributed nature. Obviously the term itself says
distributed means multiple entity can work together on the same application being remotely
that means network based application needs to be designed which is called distributed application.
So java has a predefined API. When I say an API you can consider your API similar to your
header files in C++ or a C programming language where you have a predefined set of methods
which help you to do your low level tasks or your ground level tasks right. To print anything
to your standard output device you use your printf method or you may use your cout object right.
So they are predefined object and function which was available in the form of C++ library
header files. Similar way java provides predefined classes. Why classes? Because java is object
okay and I would request all of you to always have ask google to give you the link for java
API doc. This documentation I can download it offline and can use it. I will show you I do
have it in okay. I have downloaded and extracted but this is what exactly the view of your API
okay. So it is exactly similar to your header files in a C or in a C++ program.
What your API is comprising of? The very first API stands for your application programming
interface. Your java programming language provides you a set of predefined classes
to help java developer write their application with much more pre-built functionality okay.
So you see here these are the different packages which are designed to support different
needs of any application. I want to write an application where I may be displaying a font
in a different different family, different style, maybe with different format. So I do have
an API which helps me to design the font of my any GUI application. So this is my package
which has a different predefined classes which helps you to design the font over
any graphical image okay. Apart from this let's say I wanted to write some data or read some data
from any Word, Notepad, Excel, any flat file. Can I do so? If so, if I need to do it with C++,
what do you have to do? Your file io.h header file. Am I right? Similar thing is provided to
you as java.io API which gives you more leverage over reading the data in a different different
format. When you were using C++, you were only able to read the data in the form of
character or an array of character type, maybe in the form of primitive type, int type,
char type, boolean type, that's it. But java provides you a set of classes which helps you to
read one complete object at a point in time. When I say one complete object, my object may be
comprising of, imagine about your student object. What are the properties you can imagine for
student object? Student's name, student's roll number, address, the stream for which he or she
is enrolled. And let's say any financial details or let's say the academic details.
So I would just mention it as academic. So java provides you a class which not only reads one
one value at a point in time. When I am talking about a bulk data to be read it from backend
database and to be given to my frontend. If I start reading one value at a time and let's say
there are thousand student records are there to read from the database, how much time it will take?
What would be the performance level of such application? How can I improve this performance?
And that is what by using your object input output string classes which you can see here.
You will see them in function, how to use, where to use, how to write the syntax,
what it actually does. So it can read rather than reading one one type of value, it reads
complete object of student type. Let's say read the data of a student called Nina.
So what detail it get? So name as Nina, roll number as let's say first and let's say address
is let's say B and let's say the stream is let's say C that's computer science.
And let's say academic details or whatever this data is already something like this. So
entire data will be read as a single object from the database. So how many times I need to read
only thousand records, not thousand multiplied by five different values, not at all, right?
That is what an advantage of having a set of redefined classes which takes care of all ground
level work to work upon the data back and forth when we are writing any application.
This is just an example I am giving you what Java gives us as a basic support.
Let's continue about the multi-threaded application. As we already know about the
Now, nowadays, people may want to do multiple things being on a single operating system
like your smartphone. When I'm using my smartphone, I may be visiting the different
social networking websites like Twitter, LinkedIn, and many more. At the same time,
I may be listening the music, I may be chatting with my friends, colleagues over a WhatsApp and
many more tasks, right? And that is what we all love to do and is necessary as well
to being connected over the world, okay? And that is what required by each and every device
should be capable of performing multiple tasks at the same point in time. That is what actually
delivered by Java using something called as multi-threaded benefits or multi-threaded feature
which is a part of your core Java content itself. We will start with the multi-threading as a module,
okay? So, there you will see we will be writing an application which does multiple tasks at the
same time. My application can be developed as a robust application. What do you mean by a robust
word or its terminology? What do you mean by a robust? If I'll say it according to the English
dictionary, what do you mean by a robust? Strong enough programming language which is capable to
upgrade itself whenever any additional support or any new technical funders or fundamental
requirements comes into the market or in a very raw manner I'll say. Java is robust because
it is highly supported language by any device. It is portable across any operating system.
It also has a feature of automatic memory management to strongly keep its execution
memory refreshed without any intervention of a developer or an end user. It also implements
strong type checking which helps in making Java as most robust application. Especially,
Java programming language is known for its less crashing bugs and very rare into
any of the system crash scenarios and that makes Java most robust application programming language,
okay? So, that's all about the key benefits of Java language. So, here we are discussing
each key benefits. What do you mean by an object? It's very very clear to you. It is
presentation or representation of anything. To understand object, let us go in a vice versa
manner. Let us first understand what is class. Class is kind of a blueprint or I would name it
as prototype, okay? Prototype of any entity, maybe a living, non-living or any entity which
can be described into software application, employee, student, car, engine, many more things,
furnitures, tables, chairs, could be anything, a tree, okay? So, when I say a blueprint,
what do you mean by a blueprint? It is just one basic plan or one basic prototype based on which
we may imagine any entity in its existence. Let's say a blueprint of a shopping mall,
a house or maybe any construction building. Without having a blueprint in your hand,
can you instruct any labor to put up a window at particular corner and put up your
entry-exit gate at other corner? No, we can't decide that. So, to decide where to place actually
in a real time that it should keep a gap of entry-exit gate and a window, you first need to
chalk up a blueprint or a prototype plan for anything and that is exactly what your class.
When I say I need to have a blueprint of an employee, the moment I say an employee,
what comes in your mind? An employee may have a name, may have a project assigned to them,
may have a particular what is we call it as a job role, may have a department associated to
themselves, may be having department name, department ID, may be having a salary,
date of joining, date of birth, many more details. So, that is a blueprint in our mind
because we are knowing who is an employee, who can be an employee. So, when I say a class,
it is actually a collection of properties and behaviors, definition, okay, which is acting
as a prototype. I said they are an employee but when I say an employee called Shubhada,
so definitely you are defining the employee's name property as a Shubhada, date of birth
as let's say triple x and let's say a date of joining as triple y. So, you are going more
precise about an employee object, okay. The moment you tie up a data to your class property,
it becomes an object. Let us continue understanding some more terminology which
may be used with job. Platform independence, I need not to explain you about because
you know kind of a smart enough to understand. When I say a platform independence,
what do you mean by platform? An operating system, right. What your operating system needs
to support an execution of any programming application or any software application?
Obviously, the runtime which is required by my software application. Go for downloading the JDK
which is Java Development Kit. Okay, I'll explain you the difference. You will see
the different type of JDK versions. Now, look at here. What is your platform? On what
beat size it is running? So, for every platform, there is a separate JRE available.
You want to see the JRE itself? So, let me just change my search criteria from JDK JRE,
okay. Runtime environment, you will find the same list of supportive or descriptive operating
system. For each operating system, there is a separate runtime environment to be installed,
okay. And this runtime environment, any of the format or any of the version of runtime environment
can understand the format which is .class, which is called a byte code, gets generated by
Java compiler. And this byte code is platform independent, okay. So, this byte code could be
understood by any JRE, whether it is on a Linux version, whether it is on a Solaris version,
or it is on a Windows version. No matter what JRE you are using on whichever operating system,
I am only bothered about JRE, okay. What its underlying platform, I am not bothered on it,
because my JRE will take care of my .class version to be converted to .exe depending upon
the type of an operating system and convert it to binary. And that is how
Java achieves the platform independent. Here, this is just a small idea to be given to you.
You are learning Java and JDK, right, where the technologies would lie in, where you are going
to use them. So, when I talk about the presentation, presentation means your web page,
how my web page will be designed, what my web page will do, where it will get connected. So,
those all things would be designed with your J2EE components called servlet JST.
To understand servlet JST, you must have a knowledge of core Java, okay. So, it is
kind of to understand an importance of a smartphone, I must have a knowledge of basic
internet usage. If I am totally new to what internet is, I won't be able to download my
WhatsApp, Facebook, my Skype, any other applications which connects me over the net
and helps me to be communicated over my social networking era, okay. So, that is core Java is
very much important to understand your J2EE and that is why we are starting with the core Java,
okay, because that is you are going to use along.
