<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7676061512291121409</atom:id><lastBuildDate>Sat, 28 Mar 2026 14:09:50 +0000</lastBuildDate><category>Core java tutorial</category><category>Kubernetes</category><category>Spring boot2</category><category>springboot2</category><category>Quartz</category><category>Spring Batch</category><category>Spring boot spring data Cassandra crud example</category><category>abstract in oops</category><category>abstract keyword in java</category><category>abstraction in java</category><category>apache kafka</category><category>apache kafka windows</category><category>basic java questions</category><category>best react book 2020</category><category>best react books</category><category>best react books 2020</category><category>cassandra spring boot</category><category>cassandra with spring boot</category><category>cast class java</category><category>cast object java</category><category>casting in java</category><category>core java interview questions</category><category>core java interview questions and answers</category><category>core java interview questions for experienced</category><category>define interface in java</category><category>explain public static void main</category><category>extends in java</category><category>extends keyword in java</category><category>how to install minikube in ubuntu</category><category>inheritance in java</category><category>inheritance in oops</category><category>install apache kafka on windows</category><category>install minikube in ubuntu</category><category>installing kafka</category><category>installing kafka on windows</category><category>installing kubernetes</category><category>installing kubernetes ubuntu</category><category>interface java</category><category>interview questions</category><category>java abstract class</category><category>java abstract class example</category><category>java basic interview questions</category><category>java cast string</category><category>java class extends</category><category>java inheritance example</category><category>java interface</category><category>java public static void main</category><category>java substring</category><category>k8s deployment</category><category>kafka for beginners</category><category>kafka multi broker</category><category>kafka multi broker cluster setup</category><category>kafka on windows</category><category>kafka tutorials</category><category>kubectl delete deployment</category><category>kubernetes cluster</category><category>kubernetes deployment</category><category>kubernetes deployment yaml</category><category>kubernetes pod</category><category>kubernetes replica set</category><category>kubernetes replicaset</category><category>mongodb spring boot</category><category>pod kubernetes</category><category>public abstract class</category><category>public static void main</category><category>replicaset kubernetes</category><category>spring boot 2 Quartz</category><category>spring boot cassandra</category><category>spring boot cassandra example</category><category>spring boot jpa</category><category>spring boot jpa example</category><category>spring boot jpa h2 database</category><category>spring boot jpa h2 database example</category><category>spring boot mongodb</category><category>spring boot mongodb example</category><category>spring boot mongodb reactive</category><category>spring boot reactive mongodb</category><category>spring boot reactive mongodb example</category><category>spring boot rest api</category><category>spring boot rest example</category><category>spring boot rest service</category><category>spring boot restful web services json example</category><category>spring boot spring data jpa h2 database crud example</category><category>spring boot spring data mongodb crud example</category><category>spring boot spring data mongodb example</category><category>spring boot webflux mongodb</category><category>spring boot with cassandra</category><category>spring crudrepository</category><category>spring data mongodb</category><category>spring mongodb</category><category>spring mongodb reactive</category><category>spring reactive mongodb</category><category>spring rest api</category><category>spring rest tutorial</category><category>spring restful web services</category><category>string java substring</category><category>substring in java</category><category>substring java</category><category>upcasting java</category><category>use of abstract class in java</category><title>Java Beginners Tutorial - How to program in JAVA</title><description>java Beginners tutorial is a website that teaches how to program in java and provides free and easy to understand java tutorials for beginners with example code and clear explanations</description><link>https://javasneo.blogspot.com/</link><managingEditor>noreply@blogger.com (Abderrahmen Ben Mariem)</managingEditor><generator>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-6873215091828524337</guid><pubDate>Fri, 01 Jan 2021 22:32:00 +0000</pubDate><atom:updated>2021-01-01T23:35:47.486+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">kafka multi broker</category><category domain="http://www.blogger.com/atom/ns#">kafka multi broker cluster setup</category><title>Kafka multi broker cluster setup on windows 10 | kafka tutorials</title><description>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4oWcZS4mO0qdUXul5IHh1NDPoeTRLy9TXS3qz26U0WMoI4-SS4K_A06zM7JhiPqajmryL1UXNnVVxsFIs11DIaVEdBsh5MMihw7uoxg7jDLE_lY_3mDY0I-qu9yExEqrfrHUwZYLmsnc/s522/Kafka-multi-broker-cluster-setup-on-windows-10.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Kafka multi broker cluster setup on windows 10&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4oWcZS4mO0qdUXul5IHh1NDPoeTRLy9TXS3qz26U0WMoI4-SS4K_A06zM7JhiPqajmryL1UXNnVVxsFIs11DIaVEdBsh5MMihw7uoxg7jDLE_lY_3mDY0I-qu9yExEqrfrHUwZYLmsnc/w640-h392/Kafka-multi-broker-cluster-setup-on-windows-10.jpg&quot; title=&quot;Kafka multi broker cluster setup on windows 10&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Kafka multi broker cluster setup on windows 10&lt;/b&gt;
tutorial shows step by step &lt;i&gt;how to setup apache kafka multi broker cluster
on wirdows 10&lt;/i&gt;.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to know how to install and setup a single broker
cluster on windows, you should check this &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2021/01/install-apache-kafka-on-windows-10.html&quot; target=&quot;_blank&quot;&gt;apache kafka install tutorial&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Create Apache Kafka configurations for two brokers&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;

&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;We should duplicate the file config/server.properties
two times to create the configurations of the two brokers. In order to do that,
we execute these commands :&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;copy config/server.properties config/server-1.properties
copy config/server.properties config/server-2.properties 
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Then, we change the following properties of the two files to
be the followings&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;config/server-1.properties:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;broker.id=1&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;listeners=PLAINTEXT://:9093&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;log.dir=/tmp/kafka-logs-1&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;config/server-2.properties:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;broker.id=2&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;listeners=PLAINTEXT://:9094&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span face=&quot;Calibri, sans-serif&quot; style=&quot;font-size: 11pt;&quot;&gt;log.dir=/tmp/kafka-logs-2&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Startup the tree Apache Kafka nodes&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Before starting apache kafka, you should startup the Zookeeper
like what is explained in this &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2021/01/install-apache-kafka-on-windows-10.html&quot; target=&quot;_blank&quot;&gt;apache kafka install tutorial&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;Then, you can start the three kafka brokers using these
commands&amp;nbsp;&lt;/span&gt;&lt;/div&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-server-start.bat config/server.properties
bin/windows/kafka-server-start.bat config/server-1.properties
bin/windows/kafka-server-start.bat config/server-2.properties
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;In fact, you should run each command in a separate terminal.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Create new topic replicated to all 3 brokers&lt;/b&gt;&lt;/h2&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Creating apache kafka topic&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to create an apache Kafka topic, you should run
this command&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 3 --partitions 1 --topic replicated-topic
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;This command creates a topic called replicated-topic that we
will use to send and receive messages.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Visualizing apache kafka topic&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We can visualize apache kafka topic using this command&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-topics.sh --describe --zookeeper localhost:2181 --topic replicated-topic 
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;In order to check how to produce and consume messages,
please check this &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2021/01/install-apache-kafka-on-windows-10.html&quot; target=&quot;_blank&quot;&gt;apache kafka setup tutorial&lt;/a&gt;&lt;/b&gt;.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Conclusion&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This &lt;b&gt;Kafka multi broker cluster setup&lt;/b&gt;&lt;/span&gt;&lt;b&gt; on windows 10 tutorial &lt;/b&gt;arrives
at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;You may check also our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt; to learn core java from
scratch. Please keep tuned because we will release more tutorials about apache
kafka and java microservices.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to get our latest updates, please feel free to like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&lt;/b&gt; facebook page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;</description><link>https://javasneo.blogspot.com/2021/01/kafka-multi-broker-cluster-setup-on-windows.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4oWcZS4mO0qdUXul5IHh1NDPoeTRLy9TXS3qz26U0WMoI4-SS4K_A06zM7JhiPqajmryL1UXNnVVxsFIs11DIaVEdBsh5MMihw7uoxg7jDLE_lY_3mDY0I-qu9yExEqrfrHUwZYLmsnc/s72-w640-h392-c/Kafka-multi-broker-cluster-setup-on-windows-10.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-9003628646573011891</guid><pubDate>Fri, 01 Jan 2021 16:44:00 +0000</pubDate><atom:updated>2021-01-01T17:44:34.484+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">apache kafka</category><category domain="http://www.blogger.com/atom/ns#">apache kafka windows</category><category domain="http://www.blogger.com/atom/ns#">install apache kafka on windows</category><category domain="http://www.blogger.com/atom/ns#">installing kafka</category><category domain="http://www.blogger.com/atom/ns#">installing kafka on windows</category><category domain="http://www.blogger.com/atom/ns#">kafka for beginners</category><category domain="http://www.blogger.com/atom/ns#">kafka on windows</category><category domain="http://www.blogger.com/atom/ns#">kafka tutorials</category><title>Install apache kafka on windows 10 | kafka tutorials</title><description>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSmyr9M18Uz45qnvsauQivto6M4DcZlxEv7xb5SXLLoHwN02tXRSj0vEqlUqLsgtXtJF8HSZXYhtNHijar68mClnzg3GiPVwTWr5jghj7XdD_q-i9IshblYMtCbWP7PmLaeCNyXxNOPXI/s522/install-apache-kafka-windows-10.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install apache kafka on windows 10&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSmyr9M18Uz45qnvsauQivto6M4DcZlxEv7xb5SXLLoHwN02tXRSj0vEqlUqLsgtXtJF8HSZXYhtNHijar68mClnzg3GiPVwTWr5jghj7XdD_q-i9IshblYMtCbWP7PmLaeCNyXxNOPXI/w640-h392/install-apache-kafka-windows-10.jpg&quot; title=&quot;install apache kafka on windows 10&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Install apache kafka on windows 10&lt;/b&gt; tutorial shows
step by step &lt;i&gt;how to install apache kafka on wirdows 10&lt;/i&gt;.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Download and install Apache Kafka&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;First of all, you should download the compressed version of
kafka from the kafka &lt;a href=&quot;https://kafka.apache.org/downloads&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;website&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In fact, you should already have the JDK installed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Then, you should put the zipped version of apache Kafka at
the root of C:\ drive. This avoids the error that says command is too long.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Now, you should uncompress it using this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;tar -xzf &amp;lt;kafka tarball&amp;gt;
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Startup Apache Kafka&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Before starting apache kafka, you should startup the Zookeeper
using this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/zookeeper-server-start.bat config/zookeeper.properties
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Then, you can start the kafka server using this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-server-start.bat config/server.properties
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;In order to allow the Kafka server to connect to the
zookeeper, you should change these parameters in the kafka server configuration
file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In the server.properties in the config folder, you should
make these modifications&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;zookeeper.connection.timeout.ms=60000
#broker.id=0
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Creating and visualising Apache Kafka topics&lt;/b&gt;&lt;/h2&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Creating apache kafka topic&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to create an apache Kafka topic, you should run
this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;This command creates a topic called test that we will use to
send and receive messages.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Visualizing apache kafka topic&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We can visualize apache kafka topic using this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-topics.bat --list --zookeeper localhost:2181
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Producing and consuming messages using Apache Kafka&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Before launching the kafka producer and consumer programs,
we should make sure that both the zookeeper and the kafka server are up and
running.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Producing messages&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;To launch the kafka console producer executable, we should
run this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-console-producer.bat --broker-list localhost:9092 --topic test
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;This command sends the data entered in the console to the
kafka server. So that, the receiver program listening to the test topic will
receive it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Consuming messages&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to receive the data from the test topic, we should
run this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Stopping Apache Kafka server and the zookeeper&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We shouldn’t stop apache kafka server and the zookeeper
using CTRL + C command because we may cause a data corruption.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;To stop the kafka server, we should run this command&amp;nbsp;:&lt;/span&gt;&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/kafka-server-stop.bat
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;In order to stop the zookeeper, we should run this command&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;bin/windows/zookeeper-server-stop.bat
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Conclusion&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This &lt;b&gt;install apache kafka on windows 10 tutorial &lt;/b&gt;arrives at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;You may check also our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt; to learn core java from
scratch. Please keep tuned because we will release more tutorials about apache
kafka and java microservices.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to get our latest updates, please feel free to like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjavahttps://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&lt;/b&gt; facebook page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;</description><link>https://javasneo.blogspot.com/2021/01/install-apache-kafka-on-windows-10.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSmyr9M18Uz45qnvsauQivto6M4DcZlxEv7xb5SXLLoHwN02tXRSj0vEqlUqLsgtXtJF8HSZXYhtNHijar68mClnzg3GiPVwTWr5jghj7XdD_q-i9IshblYMtCbWP7PmLaeCNyXxNOPXI/s72-w640-h392-c/install-apache-kafka-windows-10.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-104159667017851153</guid><pubDate>Fri, 18 Dec 2020 07:57:00 +0000</pubDate><atom:updated>2020-12-18T09:02:13.014+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">spring boot mongodb reactive</category><category domain="http://www.blogger.com/atom/ns#">spring boot reactive mongodb</category><category domain="http://www.blogger.com/atom/ns#">spring boot reactive mongodb example</category><category domain="http://www.blogger.com/atom/ns#">spring boot webflux mongodb</category><category domain="http://www.blogger.com/atom/ns#">spring mongodb reactive</category><category domain="http://www.blogger.com/atom/ns#">spring reactive mongodb</category><category domain="http://www.blogger.com/atom/ns#">springboot2</category><title>Spring boot spring data MongoDB reactive crud example | JAVASNEO</title><description>&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatMwOsg10s9ifvkFfj2_ewEb18ShGRZvuGY5nVhWsi5HzWlUZFKOACDs4DHk-EDaatGDC8OzZTaT208G5TKy94CYDhyeTOCBWtWK_6fxmk57kadyYiu5-ixwP5DacUOfo5Elf8VZ5Uno/s522/spring-boot-mongodb-crud-reactive-example.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring boot Spring data Mongodb reactive crud example&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatMwOsg10s9ifvkFfj2_ewEb18ShGRZvuGY5nVhWsi5HzWlUZFKOACDs4DHk-EDaatGDC8OzZTaT208G5TKy94CYDhyeTOCBWtWK_6fxmk57kadyYiu5-ixwP5DacUOfo5Elf8VZ5Uno/w640-h392/spring-boot-mongodb-crud-reactive-example.jpg&quot; title=&quot;Spring boot Spring data Mongodb reactive crud example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Spring boot spring data MongoDB
reactive crud example&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt; tutorial
that explains how to create a REST api using Spring boot 2, Spring data MongoDB
reactive, Spring Webflux and MongoDB database.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;This tutorial is a modification of
the tutorial &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-mongodb-crud-example.html&quot; target=&quot;_blank&quot;&gt;Spring Boot Spring Data MongoDB database tutorial&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: normal; margin-bottom: 0cm; text-align: left;&quot;&gt;&lt;b&gt;Adding Spring data MongoDB reactive
and Spring webflux maven dependencies&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;Spring Webflux replaces Spring MVC and implements the
Reactor framework. It has the same annotations as Spring MVC and it doesn’t dépend
on the Servlet API.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The dependencies to be added to the maven POM file are the
followings :&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;spring-boot-starter-webflux&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;spring-boot-starter-data-mongodb-reactive&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Setting up Spring Data Mongo Reactive Repository using
JAVA configuration class&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The configuration class of the Spring Data MongoDB reactive
Repository is the following:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.repository.config.EnableReactiveMongoRepositories;

@Configuration
@EnableReactiveMongoRepositories(basePackages = &quot;com.javasneo.todolist.repository&quot;)
public class ReactiveMongoConfig {
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Here, we activate Spring Data Mongo Reactive Repositories by
providing the package where those repositories can be found.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Updating the REST API to use MongoDB database reactive&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to update the &lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-jpa-h2-database-crud-example.html&quot; target=&quot;_blank&quot;&gt;Spring Boot REST API example&lt;/a&gt;&lt;/span&gt;, we will&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update repository that makes the CRUD operations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update service that uses this repository&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update the controller to use this service&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;text-align: left; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to be full reactive, the repositories, the services
and the controllers should return a reactive type (Flux, Mono) and take a reactive type as possible.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;To get a good introduction about Spring webflux and the
reactive programming using Spring Framework 5, you may check the part 3 of this
&lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;https://amzn.to/3raF0bu&quot;&gt;book&lt;/a&gt;&lt;/span&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Repository&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The repository is a &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/what-is-java-interface-tutorial.html&quot; target=&quot;_blank&quot;&gt;java interface&lt;/a&gt; &lt;/b&gt;with no&lt;b&gt; &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;javaclass&lt;/a&gt; &lt;/b&gt;implementing it&lt;b&gt;. &lt;/b&gt;This is a spring Data Mongodb reactive
feature that auto-generates the CRUD code for us based on an interface that we
specify.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The code of the repository is the following&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.repository;

import com.javasneo.todolist.model.Todo;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;

public interface TodoRepository extends ReactiveMongoRepository&amp;lt;Todo, String&amp;gt; {
}
&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The TodoRepository interface should extend the Spring Data MongoDB
reactive interface ReactiveMongoRepository and give two parameters to that
interface&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;The first one is the Type of the Entity that we will
generate the CRUD code for.&lt;/li&gt;&lt;li&gt;The second one is the type of the primary key of the entity
(the id attribute in the Todo class is of type String)&lt;/li&gt;&lt;/ul&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Service&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The service layer of the application is composed by the
interface of the service and its implementation. Here, we changed the return
type of the methods to be either Mono or Flux.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;The source code of the interface is the
following&amp;nbsp;:&lt;/span&gt;&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public interface TodoService {
  Flux&amp;lt;Todo&amp;gt; getAll();
  Mono&amp;lt;Todo&amp;gt; saveOrUpdate(Todo todo);
  void delete(String id);
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the implementation is the
following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.repository.TodoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Service
public class TodoServiceImpl implements TodoService{
  @Autowired
  TodoRepository todoRepository;

  public Flux&amp;lt;Todo&amp;gt; getAll(){
    return todoRepository.findAll();
  }

  public Mono&amp;lt;Todo&amp;gt; saveOrUpdate(Todo todo)
  {
    return todoRepository.save(todo);
  }

  public void delete(String id)
  {
    todoRepository.deleteById(id);
  }

}&lt;/pre&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API controller&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The REST controller uses the service layer to provide the
CRUD endpoints.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the controller is the following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.controller;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.service.TodoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@RestController
@RequestMapping(&quot;/todos&quot;)
@CrossOrigin()
public class TodoController {

  @Autowired
  TodoService todoService;

  @RequestMapping(method = RequestMethod.GET)
  public Flux&amp;lt;Todo&amp;gt; todos (){
    return todoService.getAll();
  }

  @RequestMapping(method = RequestMethod.POST)
  public Mono&amp;lt;Todo&amp;gt; addtodo (@RequestBody Todo todo){
    return todoService.saveOrUpdate(todo);
  }


  @RequestMapping(method = RequestMethod.PUT)
  public Mono&amp;lt;Todo&amp;gt; updateTodo (@RequestBody Todo todo){
    return todoService.saveOrUpdate(todo);
  }

  @RequestMapping(value=&quot;/{id}&quot;, method = RequestMethod.DELETE)
  public void deleteTodo (@PathVariable(&quot;id&quot;) String id){
    todoService.delete(id);
  }

}
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 16.0pt; line-height: 107%;&quot;&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This &lt;b&gt;spring boot spring data MongoDB reactive crud example tutorial &lt;/b&gt;arrives
at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;If you want to know how to test the endpoints using Postman, please check
the part 1 of these series of tutorials that deal with &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/search/label/Spring%20boot2&quot; target=&quot;_blank&quot;&gt;Spring Boot 2 REST API&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;You may check also our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt; to learn core java from
scratch. Please keep tuned because we will release more tutorials about Spring
Boot, unit testing, integration testing and other important subjects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to get our latest updates, please feel free to like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&lt;/b&gt; facebook page.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-mongodb-reactive-crud-example.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhatMwOsg10s9ifvkFfj2_ewEb18ShGRZvuGY5nVhWsi5HzWlUZFKOACDs4DHk-EDaatGDC8OzZTaT208G5TKy94CYDhyeTOCBWtWK_6fxmk57kadyYiu5-ixwP5DacUOfo5Elf8VZ5Uno/s72-w640-h392-c/spring-boot-mongodb-crud-reactive-example.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-6874021205298402894</guid><pubDate>Wed, 16 Dec 2020 19:43:00 +0000</pubDate><atom:updated>2020-12-18T08:38:31.509+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cassandra spring boot</category><category domain="http://www.blogger.com/atom/ns#">cassandra with spring boot</category><category domain="http://www.blogger.com/atom/ns#">spring boot cassandra</category><category domain="http://www.blogger.com/atom/ns#">spring boot cassandra example</category><category domain="http://www.blogger.com/atom/ns#">Spring boot spring data Cassandra crud example</category><category domain="http://www.blogger.com/atom/ns#">spring boot with cassandra</category><category domain="http://www.blogger.com/atom/ns#">springboot2</category><title>Spring boot spring data Cassandra crud example | JAVASNEO</title><description>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyX4EM7_0N1RmbqGEGCg08ijDbvHFMgMBdfZt3rAFE9uMoqN9j-ZeboRVT32Sp-pCl5oF-iYadoars31UJpyYUenoB5jzKo1sHm-ycXX72qnx9P9bGk32Tu3JUEHnO9NtGskATq_yO8QE/s522/spring-boot-spring-data-cassandra-crud-example.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring boot spring data Cassandra crud example&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyX4EM7_0N1RmbqGEGCg08ijDbvHFMgMBdfZt3rAFE9uMoqN9j-ZeboRVT32Sp-pCl5oF-iYadoars31UJpyYUenoB5jzKo1sHm-ycXX72qnx9P9bGk32Tu3JUEHnO9NtGskATq_yO8QE/w640-h392/spring-boot-spring-data-cassandra-crud-example.jpg&quot; title=&quot;Spring boot spring data Cassandra crud example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Spring boot spring data Cassandra crud
example&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt; tutorial
that explains how to create a REST api using Spring boot 2, Spring data Cassandra
and Cassandra database.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;This tutorial is a modification of
the tutorial &lt;/span&gt;&lt;span style=&quot;color: red; font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-jpa-h2-database-crud-example.html&quot; target=&quot;_blank&quot;&gt;Spring Boot Spring Data H2 database tutorial&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;line-height: normal; margin-bottom: 0cm; text-align: left;&quot;&gt;&lt;b&gt;Adding Spring data Cassandra maven
dependency&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;You should install Python 2.7 and Cassandra community in
order to follow this tutorial.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;You can download Python 2.7 from this &lt;a href=&quot;https://www.python.org/download/releases/2.7/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;link&amp;nbsp;&lt;/a&gt; .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;You can also download cassandra 3.11.6 from this &lt;a href=&quot;http://archive.apache.org/dist/cassandra/3.11.6/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Cassandra has a problems with Python 3.x and JAVA 11. This
is why i am using an old version of Python and jdk1.8.0_221.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The dependency to be added to the maven POM file is the
following :&lt;/p&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;spring-boot-starter-data-cassandra&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Setting up Cassandra database using JAVA configuration
file&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The configuration file of Cassandra is the following:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.config;
import com.datastax.oss.driver.api.core.CqlSession;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.cassandra.SessionFactory;
import org.springframework.data.cassandra.config.*;
import org.springframework.data.cassandra.core.CassandraOperations;
import org.springframework.data.cassandra.core.CassandraTemplate;
import org.springframework.data.cassandra.core.convert.CassandraConverter;
import org.springframework.data.cassandra.core.convert.MappingCassandraConverter;
import org.springframework.data.cassandra.core.mapping.CassandraMappingContext;
import org.springframework.data.cassandra.core.mapping.SimpleUserTypeResolver;
import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories;

@Configuration
@EnableCassandraRepositories(
  basePackages = &quot;com.javasneo.todolist.repository&quot;)
public class CassandraConfig extends AbstractCassandraConfiguration {
  @Override
  protected String getKeyspaceName() {
    return &quot;abderrahmen&quot;;
  }
  
  public String getContactPoints() {
    return &quot;localhost&quot;;
  }

  @Override
  protected String getLocalDataCenter() {
    return &quot;datacenter1&quot;;
  }

  @Bean
  @Primary
  public CqlSessionFactoryBean session() {

    CqlSessionFactoryBean session = new CqlSessionFactoryBean();
    session.setContactPoints(getContactPoints());
    session.setKeyspaceName(getKeyspaceName());
    session.setLocalDatacenter(getLocalDataCenter());
    return session;
  }

  @Bean
  @Primary
  public SessionFactoryFactoryBean sessionFactory(CqlSession session, CassandraConverter converter) {
    SessionFactoryFactoryBean sessionFactory = new SessionFactoryFactoryBean();
    sessionFactory.setSession(session);
    sessionFactory.setConverter(converter);
    sessionFactory.setSchemaAction(SchemaAction.NONE);
    return sessionFactory;
  }

  @Bean
  @Primary
  public CassandraMappingContext mappingContext(CqlSession cqlSession) {

    CassandraMappingContext mappingContext = new CassandraMappingContext();
    mappingContext.setUserTypeResolver(new SimpleUserTypeResolver(cqlSession));
    return mappingContext;
  }

  @Bean
  @Primary
  public CassandraConverter converter(CassandraMappingContext mappingContext) {
    return new MappingCassandraConverter(mappingContext);
  }

  @Bean
  public CassandraOperations cassandraTemplate(SessionFactory sessionFactory, CassandraConverter converter) {
    return new CassandraTemplate(sessionFactory, converter);
  }

}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Here, i set set the keyspace as abderrahmen and i set the
local data center as datacenter1 (the default value). That keyspace is used
when creating our Todo table in Cassandra.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Updating the REST API to use Cassandra database&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In order to update the &lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-jpa-h2-database-crud-example.html&quot; target=&quot;_blank&quot;&gt;Spring Boot REST API example&lt;/a&gt;&lt;/span&gt;, we will&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update the model to add Cassandra annotations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update repository that makes the CRUD operations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update service that uses this repository&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update the controller to use this service&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Model&lt;/b&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We will add the Cassandra annotations to the Todo entity in
order to make it managed by &lt;i&gt;Spring Data Cassandra&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The required annotations are&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;@Table&amp;nbsp;: to make the class a Cassandra
table&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;@PrimaryKey&amp;nbsp;: to make a field a primary key&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l1 level1 lfo2; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In this class, we can get rid of Getters, Setters and
constructors by using lombok. But, i don’t do it for the sake of simplicity and
to make the beginners understand the code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;
&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The code of the class is the following&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.model;
import org.springframework.data.cassandra.core.mapping.PrimaryKey;
import org.springframework.data.cassandra.core.mapping.Table;
import java.util.UUID;

@Table
public class Todo {

  @PrimaryKey
  private UUID id;
  private String name;
  private String description;

  public Todo() {
  }

  public Todo(UUID id, String name, String description) {
    this.id = id;
    this.name = name;
    this.description = description;
  }

  public UUID getId() {
    return id;
  }

  public void setId(UUID id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public String getDescription() {
    return description;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setDescription(String description) {
    this.description = description;
  }
}
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Repository&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The repository is a &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/what-is-java-interface-tutorial.html&quot; target=&quot;_blank&quot;&gt;java interface&lt;/a&gt; &lt;/b&gt;with no&lt;b&gt; &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;javaclass&lt;/a&gt; &lt;/b&gt;implementing it&lt;b&gt;. &lt;/b&gt;This is a spring Data Cassandra feature that
auto-generates the CRUD code for us based on an interface that we specify.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The code of the repository is the following&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.repository;

import com.javasneo.todolist.model.Todo;
import org.springframework.data.cassandra.repository.CassandraRepository;

import java.util.UUID;

public interface TodoRepository extends CassandraRepository&amp;lt;Todo, UUID&amp;gt; {
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The TodoRepository interface should extend the Spring Data Cassandra
interface CassandraRepository and give two parameters to that interface&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The first one is the Type of the Entity that we
will generate the CRUD code for.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The second one is the type of the primary key of
the entity (the id attribute in the Todo class is of type UUID)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;margin-left: 18pt; text-align: left;&quot;&gt;&lt;b&gt;Rest API Service&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The service layer of the application is composed by the
interface of the service and its implementation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the interface is the following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;
import com.javasneo.todolist.model.Todo;
import java.util.List;
import java.util.UUID;

public interface TodoService {
  List&amp;lt;Todo&amp;gt; getAll();
  Todo create(Todo todo);
  Todo update(Todo todo);
  void delete(UUID id);
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the implementation is the
following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.repository.TodoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@Service
public class TodoServiceImpl implements TodoService{
  @Autowired
  TodoRepository todoRepository;

  public List&amp;lt;Todo&amp;gt; getAll(){
    List&amp;lt;Todo&amp;gt; todoList = new ArrayList&amp;lt;Todo&amp;gt;();
    todoRepository.findAll().forEach(todo -&amp;gt; todoList.add(todo));
    return todoList;
  }

  public Todo create(Todo todo)
  {
    return todoRepository.save(new Todo(UUID.randomUUID(), todo.getName(), todo.getDescription()));
  }
  
  public Todo update(Todo todo)
  {
    return todoRepository.save(todo);
  }

  public void delete(UUID id)
  {
    todoRepository.deleteById(id);
  }

}
&lt;/pre&gt;
&lt;h3 style=&quot;margin-left: 18pt; text-align: left;&quot;&gt;&lt;b&gt;Rest API controller&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The controller uses the service layer to provide the CRUD
endpoints.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the controller is the following&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.controller;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.model.TodoListResponse;
import com.javasneo.todolist.service.TodoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@RestController
@RequestMapping(&quot;/todos&quot;)
@CrossOrigin()
public class TodoController {

  @Autowired
  TodoService todoService;

  @RequestMapping(method = RequestMethod.GET)
  public TodoListResponse todos (){
    List&amp;lt;Todo&amp;gt; todoList = todoService.getAll();
    TodoListResponse todoListResponse = new TodoListResponse();
    todoListResponse.setTodos(todoList);
    return todoListResponse;
  }

  @RequestMapping(method = RequestMethod.POST)
  public Todo addtodo (@RequestBody Todo todo){
    return todoService.create(todo);
  }

  @RequestMapping(method = RequestMethod.PUT)
  public Todo updateTodo (@RequestBody Todo todo){
    return todoService.update(todo);
  }

  @RequestMapping(value=&quot;/{id}&quot;, method = RequestMethod.DELETE)
  public void deleteTodo (@PathVariable(&quot;id&quot;) UUID id){
    todoService.delete(id);
  }

}&lt;br /&gt;&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Cassandra table creation&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The script of the Todo table creation is the following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;create keyspace abderrahmen with replication={&#39;class&#39;:&#39;SimpleStrategy&#39;, &#39;replication_factor&#39;:1};
use abderrahmen;
 
CREATE TABLE todo(
   id uuid PRIMARY KEY,
   name text,
   description text
);
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;We run cqlsh executable present in the bin directory of
Cassandra. Then, we run the commands above. The Cassandra database should be up
and running (we should run cassandra.bat file present in the bin directory
before running cqlsh)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot REST API Testing&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Before being able to test the restful webservice, we should run cassandra
by running cassandra.bat present in the bin folder of the unzipped cassandra
folder.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;If you want to know how to test the endpoints using Postman, please check
the part 1 of these series of tutorials that deal with &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/search/label/Spring%20boot2&quot; target=&quot;_blank&quot;&gt;Spring Boot 2 REST API&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to check the data in Cassandra, we use cqlsh.bat present in the
bin directory of Cassandra community edition. The cqlsh executable gives us a
prompt that allow us to run SQL queries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;We may run «&amp;nbsp;select * from todo&amp;nbsp;» to check the content of the
todo table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 16pt; line-height: 107%;&quot;&gt;conclusion&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This &lt;b&gt;spring boot spring data Cassandra crud example tutorial &lt;/b&gt;arrives
at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;You may check also our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt; to learn core java from
scratch. Please keep tuned because we will release more tutorials about Spring
Boot, unit testing, integration testing and other important subjects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to get our latest updates, please feel free to like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&lt;/b&gt; facebook page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;The source code is present in this&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 16px;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-cassandra-crud-example.html&quot; target=&quot;_blank&quot;&gt;spring boot spring data Cassandra crud example git repository&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 16px;&quot;&gt;.&lt;/b&gt;&lt;/p&gt;
</description><link>https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-cassandra-crud-example.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyX4EM7_0N1RmbqGEGCg08ijDbvHFMgMBdfZt3rAFE9uMoqN9j-ZeboRVT32Sp-pCl5oF-iYadoars31UJpyYUenoB5jzKo1sHm-ycXX72qnx9P9bGk32Tu3JUEHnO9NtGskATq_yO8QE/s72-w640-h392-c/spring-boot-spring-data-cassandra-crud-example.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-3689832948653268899</guid><pubDate>Tue, 15 Dec 2020 15:55:00 +0000</pubDate><atom:updated>2020-12-15T20:27:22.551+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mongodb spring boot</category><category domain="http://www.blogger.com/atom/ns#">spring boot mongodb</category><category domain="http://www.blogger.com/atom/ns#">spring boot mongodb example</category><category domain="http://www.blogger.com/atom/ns#">spring boot spring data mongodb crud example</category><category domain="http://www.blogger.com/atom/ns#">spring boot spring data mongodb example</category><category domain="http://www.blogger.com/atom/ns#">Spring boot2</category><category domain="http://www.blogger.com/atom/ns#">spring data mongodb</category><category domain="http://www.blogger.com/atom/ns#">spring mongodb</category><title>Spring boot Spring data MongoDB crud example | JAVASNEO</title><description>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwu5hohpq3F64548T1T2BPfF2LAsS2K4Odf_w1SWN2fTbJeVU-m5gyIi3tXFIw7mtLEqbgWATqObuZ5WV56k75Tf81ASEt65bGSVXDF5G5fInLvAkbO8eGy3KAQtsW74F_P1TH-1leBSo/s522/spring-boot-spring-data-mongo-crud-example.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;spring boot spring data mongo crud example&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwu5hohpq3F64548T1T2BPfF2LAsS2K4Odf_w1SWN2fTbJeVU-m5gyIi3tXFIw7mtLEqbgWATqObuZ5WV56k75Tf81ASEt65bGSVXDF5G5fInLvAkbO8eGy3KAQtsW74F_P1TH-1leBSo/w640-h392/spring-boot-spring-data-mongo-crud-example.jpg&quot; title=&quot;spring boot spring data mongo crud example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Spring boot spring data MongoDB crud
example&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt; tutorial
that explains how to create a REST api using Spring boot 2, Spring data jpa and
mongoDB database.&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This tutorial is a modification of
the tutorial Spring Boot Spring Data H2 database tutorial.&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: normal; margin-bottom: 0cm; text-align: left;&quot;&gt;&lt;b&gt;Adding Spring data Mongo maven
dependency&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;MongoDB is a very famous noSql database that supports
reactive programming.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;You should install MongoDB community using this &lt;a href=&quot;https://www.mongodb.com/try/download/community&quot;&gt;link&lt;/a&gt; in order to
follow this tutorial.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The dependency to be added to the maven POM file is the
following :&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;spring-boot-starter-data-mongodb&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Setting up MongoDB database using the application.properties
file&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In the application.properties files, we provide the
connection url, the jdbc driver, the username, the password and all the
database settings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The database settings are the followings&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=mydb
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Updating the REST API to use MongoDB database&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to update the &lt;span&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-jpa-h2-database-crud-example.html&quot; target=&quot;_blank&quot;&gt;Spring Boot Spring Data JPA H2 database CRUD example&lt;/a&gt;&lt;/span&gt;, we will&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 0px;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update the model to add MongoDB annotations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Update the repository that makes the CRUD
operations&lt;/li&gt;&lt;li&gt;Update the service that uses this repository&lt;/li&gt;&lt;li&gt;Update the controller that uses this service&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Model&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We will add the Mongo annotations to the Todo entity in order
to make it managed by Spring Data Mongo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The required annotations are&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l1 level1 lfo2; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;@Document&amp;nbsp;: to make the class a MongoDB
document&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l1 level1 lfo2; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;@Id&amp;nbsp;: to make a field a primary key&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In this class, we can get rid of Getters, Setters and
constructors by using lombok. But, i don’t do it for the sake of simplicity and
to make the beginners understand the code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The code of the class is the following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.model;

import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.annotation.Id;

@Document(collection = &quot;todo&quot;)
public class Todo {

  @Id
  private String id;
  private String name;
  private String description;

  public Todo() {
  }

  public Todo(String id, String name, String description) {
    this.id = id;
    this.name = name;
    this.description = description;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public String getDescription() {
    return description;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setDescription(String description) {
    this.description = description;
  }
}
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Repository&lt;/b&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The repository is a &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/what-is-java-interface-tutorial.html&quot; target=&quot;_blank&quot;&gt;java interface&lt;/a&gt; &lt;/b&gt;with no&lt;b&gt; &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java class&lt;/a&gt; &lt;/b&gt;implementing it&lt;b&gt;. &lt;/b&gt;This is a spring Data MongoDB feature that
auto-generates the CRUD code for us based on an interface that we specify.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The code of the repository is the following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.repository;

import com.javasneo.todolist.model.Todo;
import org.springframework.data.mongodb.repository.MongoRepository;
public interface TodoRepository extends MongoRepository&amp;lt;Todo, String&amp;gt; {
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The TodoRepository interface should extend the Spring Data MongoDB
interface MongoRepository and give two parameters to that interface&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The first one is the Type of the Entity that we
will generate the CRUD code for.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The second one is the type of the primary key of
the entity (the id attribute in the Todo class is of type String)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Service&lt;/b&gt;&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 0px;&quot;&gt;&lt;span style=&quot;text-indent: -24px;&quot;&gt;The service layer of the application is composed by the
interface of the service and its implementation.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;text-indent: 0px;&quot;&gt;&lt;span style=&quot;text-indent: -24px;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;text-indent: -24px;&quot;&gt;he source code of the interface is the following&amp;nbsp;:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;


&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;

import java.util.List;

public interface TodoService {
  List&amp;lt;Todo&amp;gt; getAll();
  Todo saveOrUpdate(Todo todo);
  void delete(String id);
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the implementation is the
following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;

import java.util.List;

public interface TodoService {
  List&amp;lt;todo&amp;gt; getAll();
  Todo saveOrUpdate(Todo todo);
  void delete(String id);
}
&lt;/pre&gt;
The source code of the implementation is the following :
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.repository.TodoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TodoServiceImpl implements TodoService{
  @Autowired
  TodoRepository todoRepository;

  public List&amp;lt;Todo&amp;gt; getAll(){
    List&amp;lt;Todo&amp;gt; todoList = new ArrayList&amp;lt;Todo&amp;gt;();
    todoRepository.findAll().forEach(todo -&amp;gt; todoList.add(todo));
    return todoList;
  }

  public Todo saveOrUpdate(Todo todo)
  {
    return todoRepository.save(todo);
  }

  public void delete(String id)
  {
    todoRepository.deleteById(id);
  }

}&lt;/pre&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API controller&lt;/b&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The controller uses the service layer to provide the CRUD
endpoints.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the controller is the following&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.controller;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.model.TodoListResponse;
import com.javasneo.todolist.service.TodoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Abderrahmen on 31/01/2018.
 */
@RestController
@RequestMapping(&quot;/todos&quot;)
@CrossOrigin()
public class TodoController {

  @Autowired
  TodoService todoService;

  @RequestMapping(method = RequestMethod.GET)
  public TodoListResponse todos (){
    List&amp;lt;Todo&amp;gt; todoList = todoService.getAll();
    TodoListResponse todoListResponse = new TodoListResponse();
    todoListResponse.setTodos(todoList);
    return todoListResponse;
  }

  @RequestMapping(method = RequestMethod.POST)
  public Todo addtodo (@RequestBody Todo todo){
    return todoService.saveOrUpdate(todo);
  }


  @RequestMapping(method = RequestMethod.PUT)
  public Todo updateTodo (@RequestBody Todo todo){
    return todoService.saveOrUpdate(todo);
  }

  @RequestMapping(value=&quot;/{id}&quot;, method = RequestMethod.DELETE)
  public void deleteTodo (@PathVariable(&quot;id&quot;) String id){
    todoService.delete(id);
  }

}
 &lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot REST API Testing&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;If you want to know how to test the endpoints using Postman, please check
the part 1 of these series of tutorials that deal with &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/search/label/Spring%20boot2&quot; target=&quot;_blank&quot;&gt;Spring Boot 2 REST API&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to check the data in MongoDB, we use MongoDB compass integrated by
default in MongoDB community edition.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This is the UI of the connection to the database&amp;nbsp;: mongodb://localhost:27017&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Here, we haven’t specified a login and a password for mongoDB in the
application.properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;We can do it using these lines of code&amp;nbsp;:&lt;/span&gt;&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=abderrahmen
spring.data.mongodb.password=password
&lt;/pre&gt;
&lt;br /&gt;


&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6q6UoXHNUrdbfl0MY8pB0ZoSUFUy_eE5rIf6EisMvqjdFYWIc3jnUnF3wSWRQZkad6aNgfAPJYoCnFmqIUfu3EbLY_KicuINWyT0z_XUvDKqdDvZzZVCChvLXX0lnoohlSVbA2M7X-MI/s1920/mongoDB-compass-connect-ui.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;mongoDB compass connect ui&quot; border=&quot;0&quot; data-original-height=&quot;976&quot; data-original-width=&quot;1920&quot; height=&quot;204&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6q6UoXHNUrdbfl0MY8pB0ZoSUFUy_eE5rIf6EisMvqjdFYWIc3jnUnF3wSWRQZkad6aNgfAPJYoCnFmqIUfu3EbLY_KicuINWyT0z_XUvDKqdDvZzZVCChvLXX0lnoohlSVbA2M7X-MI/w400-h204/mongoDB-compass-connect-ui.jpg&quot; title=&quot;mongoDB compass connect ui&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;p class=&quot;MsoNormal&quot;&gt;When clicking on connect, we can see our database mydb and
our collection todo.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJbzjnCegHqm8AXhvL9QSDaiJaL6TYY-p99YZG8NDtw2w-ZGppAesXTD-ZgJgmMoz9kd5pf1YJ_0gs6AVbMFC8pnInfnoQbil-f9lM5f4anEmKoui3eEaEt4GCH1JsP7e00lr9Pviu7-Y/s1920/mongodb-compass-view-collection.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;976&quot; data-original-width=&quot;1920&quot; height=&quot;204&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJbzjnCegHqm8AXhvL9QSDaiJaL6TYY-p99YZG8NDtw2w-ZGppAesXTD-ZgJgmMoz9kd5pf1YJ_0gs6AVbMFC8pnInfnoQbil-f9lM5f4anEmKoui3eEaEt4GCH1JsP7e00lr9Pviu7-Y/w400-h204/mongodb-compass-view-collection.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;conclusion&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;this &lt;b&gt;spring boot spring data Mongo crud example tutorial &lt;/b&gt;arrives at
its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;You may check also our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt; to learn core java from
scratch. Please keep tuned because we will release more tutorials about Spring
Boot, unit testing, integration testing and other important subjects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;





&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to get our latest updates, please feel free to like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&lt;/b&gt; facebook page.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;The source code of this tutorial is present in the github of the author &lt;a href=&quot;https://github.com/abenmariem/spring-boot-spring-data-mongodb-crud&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Abderrahmen Ben Mariem&lt;/b&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;</description><link>https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-mongodb-crud-example.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwu5hohpq3F64548T1T2BPfF2LAsS2K4Odf_w1SWN2fTbJeVU-m5gyIi3tXFIw7mtLEqbgWATqObuZ5WV56k75Tf81ASEt65bGSVXDF5G5fInLvAkbO8eGy3KAQtsW74F_P1TH-1leBSo/s72-w640-h392-c/spring-boot-spring-data-mongo-crud-example.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-1845885868978115133</guid><pubDate>Mon, 14 Dec 2020 23:14:00 +0000</pubDate><atom:updated>2020-12-15T14:18:27.383+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">spring boot jpa</category><category domain="http://www.blogger.com/atom/ns#">spring boot jpa example</category><category domain="http://www.blogger.com/atom/ns#">spring boot jpa h2 database</category><category domain="http://www.blogger.com/atom/ns#">spring boot jpa h2 database example</category><category domain="http://www.blogger.com/atom/ns#">spring boot spring data jpa h2 database crud example</category><category domain="http://www.blogger.com/atom/ns#">Spring boot2</category><category domain="http://www.blogger.com/atom/ns#">spring crudrepository</category><title>spring boot spring data jpa h2 database crud example tutorial | JAVASNEO</title><description>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgebFSwlPJHIL__cCmrvDPg1RfEkARBFWMJ2kfygJxVAbZntmxgOw7yhi53GTUvKTxq3qbOIeA-i_gTR5T-w7F7LH90mTRHNSI1JRa0KMYG_y8eLk0iJwooFtWC2pTSyLcZljMJiRlm3As/s522/spring-boot-spring-data-jpa-h2-database-crud-example.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;spring boot spring data jpa h2 database crud example&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgebFSwlPJHIL__cCmrvDPg1RfEkARBFWMJ2kfygJxVAbZntmxgOw7yhi53GTUvKTxq3qbOIeA-i_gTR5T-w7F7LH90mTRHNSI1JRa0KMYG_y8eLk0iJwooFtWC2pTSyLcZljMJiRlm3As/w640-h392/spring-boot-spring-data-jpa-h2-database-crud-example.jpg&quot; title=&quot;spring boot spring data jpa h2 database crud example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;spring boot spring data jpa h2
database crud example&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt; tutorial
that explains how to create a REST api using Spring boot 2, Spring data jpa and
h2 database.&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;This tutorial is an enhancement of
the tutorial that creates a &lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-rest-api-example-tutorial-javasneo.html.html&quot; target=&quot;_blank&quot;&gt;restful webservice&lt;/a&gt;&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;using an arrayList as our datasource.&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: normal; margin-bottom: 0cm; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Adding Spring data JPA and h2
database maven dependencies&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;H2 is an in memory database used for integration testing
when we want to test the real endpoint and we don’t want to hit the real
database (if we stop the application, we will loose the data stored in the H2
database).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We should be able to replay the tests during the build. So,
we add the data used for the tests before running the tests and we don’t depend
on the data present in the real database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We will deal with unit and integration testing of restful
webservices in a future tutorial, so please stay tuned.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The dependencies to be added to the maven POM file are the
followings&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;spring-boot-starter-data-jpa&amp;lt;/artifactId&amp;gt;
&amp;lt;/dependency&amp;gt;

&amp;lt;dependency&amp;gt;
   &amp;lt;groupId&amp;gt;com.h2database&amp;lt;/groupId&amp;gt;
   &amp;lt;artifactId&amp;gt;h2&amp;lt;/artifactId&amp;gt;
   &amp;lt;scope&amp;gt;runtime&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Setting up H2 database using the application.properties
file&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In the application.properties files, we provide the
connection url, the jdbc driver, the username, the password and all the
database settings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The database settings are the followings&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;spring.datasource.url=jdbc:h2:mem:mydb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=abderrahmen
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Here the database name is mydb.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We can make the database persistent and not volatile by
using a file to store the data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In this case, we need to change the connection URL to be
like this&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;spring.datasource.url=jdbc:h2:file:/data/mydb
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; font-family: Consolas; font-size: 10.5pt; line-height: 107%;&quot;&gt;In order to make Spring Boot create the table
used in this tutorial, we add a file in src/main/resources.This file is the
data.sql file and its content is the following&amp;nbsp;:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;DROP TABLE IF EXISTS todo;

CREATE TABLE todo (
  id INT AUTO_INCREMENT  PRIMARY KEY,
  name VARCHAR(250) NOT NULL,
  description VARCHAR(250) NOT NULL
);
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Accessing H2 database console&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;H2 database has an embedded UI that allows to run SQL
queries and manage the database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;This UI is called the H2 database console. In order to
enable this console, we should add this line in the application.properties file&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;spring.h2.console.enabled=true
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Then, we should run the application and access this URL in
the browser&amp;nbsp;: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;http://localhost:8080/h2-console&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUWonkGN_K5EcBRzxEJb7dVI6VzkeUuIUF89pQ0dwJ6KGaG4hBTTeNDGrhOKRO2qngaRjoWB7GSz2PrHdTg-osJDToc_AMqS4_a9ZG7ekbr7YdXxDGSEdqM_WSGyiBptqrJwR0f77PCc4/s579/h2-database-console.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;h2 database console&quot; border=&quot;0&quot; data-original-height=&quot;464&quot; data-original-width=&quot;579&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUWonkGN_K5EcBRzxEJb7dVI6VzkeUuIUF89pQ0dwJ6KGaG4hBTTeNDGrhOKRO2qngaRjoWB7GSz2PrHdTg-osJDToc_AMqS4_a9ZG7ekbr7YdXxDGSEdqM_WSGyiBptqrJwR0f77PCc4/w400-h320/h2-database-console.jpg&quot; title=&quot;h2 database console&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Here, we make sure that the JDBC URL is correct. Then, we
put the password present in the application.properties and we click on the connect
button.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The JDBC URL and the password should be the ones present in
the application.properties file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;After clicking on the connect button, we should see this
interface&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtQ9qU8w5V98gsWWFygHFGw73Zvx7jKB-IElQpmRokm6tmd-m_h72ZyI0MGSnW0uJrk29TdbIGxHksFrBpxyfWsTmHWYMSozzbZhh7Dkac-mkqwcHr4uLSfc848AyGKe8RfFDcSq4VD78/s1920/h2-database-console-run-sql.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;h2 database console run sql&quot; border=&quot;0&quot; data-original-height=&quot;902&quot; data-original-width=&quot;1920&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtQ9qU8w5V98gsWWFygHFGw73Zvx7jKB-IElQpmRokm6tmd-m_h72ZyI0MGSnW0uJrk29TdbIGxHksFrBpxyfWsTmHWYMSozzbZhh7Dkac-mkqwcHr4uLSfc848AyGKe8RfFDcSq4VD78/w400-h188/h2-database-console-run-sql.jpg&quot; title=&quot;h2 database console run sql&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Now, we should see the TODO table created on the application
startup.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Updating the REST API to use H2 database&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In order to update the &lt;span&gt;&lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/12/spring-boot-rest-api-example-tutorial-javasneo.html.html&quot; target=&quot;_blank&quot;&gt;Spring BootREST API example&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;, we will&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update the model to add JPA annotations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Create a new repository that makes the CRUD
operations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Create a new service that uses this repository&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Update the controller to use this service&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Model&lt;/b&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We will add the JPA annotations to the Todo entity in order
to make it managed by Spring Data JPA.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The required annotations are&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;@Entity&amp;nbsp;: to make the class a JPA entity&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;@Id&amp;nbsp;: to make a field a primary key&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;@GeneratedValue&amp;nbsp;: to make the id auto-incremented&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l1 level1 lfo2; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In this class, we can get rid of Getters, Setters and
constructors by using lombok. But, i don’t do it for the sake of simplicity and
to make the beginners understand the code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;



























&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The code of the class is the following&amp;nbsp;:&lt;/p&gt;&lt;/div&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Todo {

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private int id;
  private String name;
  private String description;

  public Todo() {
  }

  public Todo(int id, String name, String description) {
    this.id = id;
    this.name = name;
    this.description = description;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public String getDescription() {
    return description;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setDescription(String description) {
    this.description = description;
  }
}
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Rest API Repository&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The repository is a &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/what-is-java-interface-tutorial.html&quot; target=&quot;_blank&quot;&gt;java interface&lt;/a&gt; &lt;/b&gt;with no&lt;b&gt; &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java class&lt;/a&gt;
&lt;/b&gt;implementing it&lt;b&gt;. &lt;/b&gt;This is a spring Data JPA feature that auto-generates
the CRUD code for us based on an interface that we specify.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The code of the repository is the following&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.repository;

import com.javasneo.todolist.model.Todo;
import org.springframework.data.repository.CrudRepository;

public interface TodoRepository extends CrudRepository&amp;lt;Todo, Integer&amp;gt; {
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The TodoRepository interface should extend the Spring Data
JPA interface CrudRepository and give two parameters to that interface&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The first one is the Type of the Entity that we
will generate the CRUD code for.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The second one is the type of the primary key of
the entity (the id attribute in the Todo class is of type Integer)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Rest API Service&lt;/b&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The service layer of the application is composed by the
interface of the service and its implementation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the interface is the following&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;

import java.util.List;

public interface TodoService {
  List&amp;lt;Todo&amp;gt; getAll();
  Todo saveOrUpdate(Todo todo);
  void delete(int id);
}&lt;/pre&gt;
The source code of the implementation is the following :
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.service;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.repository.TodoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TodoServiceImpl implements TodoService{
  @Autowired
  TodoRepository todoRepository;

  public List&amp;lt;Todo&amp;gt; getAll(){
    List&amp;lt;Todo&amp;gt; todoList = new ArrayList&amp;lt;Todo&amp;gt;();
    todoRepository.findAll().forEach(todo -&amp;gt; todoList.add(todo));
    return todoList;
  }

  public Todo saveOrUpdate(Todo todo)
  {
    return todoRepository.save(todo);
  }

  public void delete(int id)
  {
    todoRepository.deleteById(id);
  }

}
&lt;/pre&gt;
&lt;h3 style=&quot;margin-left: 18pt; text-align: left;&quot;&gt;&lt;b&gt;Rest API controller&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The controller uses the service layer to provide the CRUD
endpoints.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The source code of the controller is the following&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.controller;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.model.TodoListResponse;
import com.javasneo.todolist.service.TodoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


@RestController
@RequestMapping(&quot;/todos&quot;)
@CrossOrigin()
public class TodoController {

  @Autowired
  TodoService todoService;

  @RequestMapping(method = RequestMethod.GET)
  public TodoListResponse todos (){
    List&amp;lt;Todo&amp;gt; todoList = todoService.getAll();
    TodoListResponse todoListResponse = new TodoListResponse();
    todoListResponse.setTodos(todoList);
    return todoListResponse;
  }

  @RequestMapping(method = RequestMethod.POST)
  public Todo addtodo (@RequestBody Todo todo){
    return todoService.saveOrUpdate(todo);
  }

  @RequestMapping(method = RequestMethod.PUT)
  public Todo updateTodo (@RequestBody Todo todo){
    return todoService.saveOrUpdate(todo);
  }

  @RequestMapping(value=&quot;/{id}&quot;, method = RequestMethod.DELETE)
  public void deleteTodo (@PathVariable(&quot;id&quot;) int id){
    todoService.delete(id);
  }

}
 &lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;this &lt;b&gt;spring boot spring data jpa h2 database crud example tutorial &lt;/b&gt;arrives
at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;If you want to know how to test the endpoints using Postman, please check
the part 1 of these series of tutorials that deal with &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/search/label/spring%20boot%20rest%20api&quot; target=&quot;_blank&quot;&gt;Spring Boot 2 RESTAPI&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;You may check also our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt; to learn core java from
scratch. Please keep tuned because we will release more tutorials about Spring
Boot, unit testing, integration testing and other important subjects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In order to get our latest updates, please feel free to like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how toprogram&lt;/a&gt;&lt;/b&gt; facebook page.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12pt; line-height: 107%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;The source code can be found in &lt;a href=&quot;https://github.com/abenmariem/spring-boot-2-rest-api-h2-database&quot; target=&quot;_blank&quot;&gt;abderrahmen ben mariem&lt;/a&gt; github.&lt;/span&gt;&lt;/p&gt;
</description><link>https://javasneo.blogspot.com/2020/12/spring-boot-spring-data-jpa-h2-database-crud-example.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgebFSwlPJHIL__cCmrvDPg1RfEkARBFWMJ2kfygJxVAbZntmxgOw7yhi53GTUvKTxq3qbOIeA-i_gTR5T-w7F7LH90mTRHNSI1JRa0KMYG_y8eLk0iJwooFtWC2pTSyLcZljMJiRlm3As/s72-w640-h392-c/spring-boot-spring-data-jpa-h2-database-crud-example.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-7317088981482752913</guid><pubDate>Sun, 13 Dec 2020 09:59:00 +0000</pubDate><atom:updated>2020-12-14T16:20:55.393+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">spring boot rest api</category><category domain="http://www.blogger.com/atom/ns#">spring boot rest example</category><category domain="http://www.blogger.com/atom/ns#">spring boot rest service</category><category domain="http://www.blogger.com/atom/ns#">spring boot restful web services json example</category><category domain="http://www.blogger.com/atom/ns#">Spring boot2</category><category domain="http://www.blogger.com/atom/ns#">spring rest api</category><category domain="http://www.blogger.com/atom/ns#">spring rest tutorial</category><category domain="http://www.blogger.com/atom/ns#">spring restful web services</category><title>Spring Boot 2 REST API Example - JAVASNEO</title><description>&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRIPfn0knOlAtIhSB4wWh-cRjNeU0ok_UJ5ZrIJhxSUzFsjwbhaJDG85S5NQnJTlHzCBzi3apuK7Ce7PAe2fEa4MdE7Q9aVc-1FxPBKQzZBfejRIzhtpF2dCBJLcWh26_yXm8ZLxtqi-0/s522/spring-boot-rest-api-example.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;spring boot rest api example tutorial&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRIPfn0knOlAtIhSB4wWh-cRjNeU0ok_UJ5ZrIJhxSUzFsjwbhaJDG85S5NQnJTlHzCBzi3apuK7Ce7PAe2fEa4MdE7Q9aVc-1FxPBKQzZBfejRIzhtpF2dCBJLcWh26_yXm8ZLxtqi-0/w640-h392/spring-boot-rest-api-example.jpg&quot; title=&quot;spring boot rest api example tutorial&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;spring boot rest api example&lt;/b&gt; tutorial presents a todo
list rest api created using spring boot 2.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The api presents 4 endpoints&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;GET api endpoint&amp;nbsp;: returns all the tod list&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;POST api endpoint&amp;nbsp;: creates a todo and ad
dit to the todo list&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;PUT api endpoint&amp;nbsp;: updates a todo&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;DELETE api endpoint&amp;nbsp;: deletes a todo&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In this &lt;i&gt;spring boot rest api example&lt;/i&gt;, we don’t use a
database. So, the todo list is stored in an arrayList in the controller that
exposes the todo list REST API.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot 2 REST API maven dependencies&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;span face=&quot;Calibri, sans-serif&quot; style=&quot;font-size: 11pt;&quot;&gt;In this project we use spring-boot-starter-web to expose the rest API and spring-boot-starter-test to make unit tests. In this &lt;/span&gt;&lt;i&gt;spring boot rest api example&lt;/i&gt;&lt;span face=&quot;Calibri, sans-serif&quot; style=&quot;font-size: 11pt;&quot;&gt;, we don’t focus on unit testing because we will create a dedicated tutorial for unit testing a REST API.&lt;/span&gt;&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;span face=&quot;Calibri, sans-serif&quot; style=&quot;font-size: 11pt;&quot;&gt;The maven POM file is the following&amp;nbsp;:&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;pre class=&quot;code-box short-b&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;

&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;

   xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&amp;gt;

   &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;

   &amp;lt;groupId&amp;gt;com.javasneo&amp;lt;/groupId&amp;gt;

   &amp;lt;artifactId&amp;gt;todo-list&amp;lt;/artifactId&amp;gt;

   &amp;lt;version&amp;gt;0.0.1-SNAPSHOT&amp;lt;/version&amp;gt;

   &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;

   &amp;lt;name&amp;gt;todo-list&amp;lt;/name&amp;gt;

   &amp;lt;description&amp;gt;Demo project for Spring Boot&amp;lt;/description&amp;gt;

   &amp;lt;parent&amp;gt;

      &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;

      &amp;lt;artifactId&amp;gt;spring-boot-starter-parent&amp;lt;/artifactId&amp;gt;

      &amp;lt;version&amp;gt;2.4.0&amp;lt;/version&amp;gt;

      &amp;lt;relativePath/&amp;gt; &amp;lt;!-- lookup parent from repository --&amp;gt;

   &amp;lt;/parent&amp;gt;

   &amp;lt;properties&amp;gt;

      &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;

      &amp;lt;project.reporting.outputEncoding&amp;gt;UTF-8&amp;lt;/project.reporting.outputEncoding&amp;gt;

      &amp;lt;java.version&amp;gt;1.8&amp;lt;/java.version&amp;gt;

   &amp;lt;/properties&amp;gt;

   &amp;lt;dependencies&amp;gt;

      &amp;lt;dependency&amp;gt;

         &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;

         &amp;lt;artifactId&amp;gt;spring-boot-starter-web&amp;lt;/artifactId&amp;gt;

      &amp;lt;/dependency&amp;gt;

      &amp;lt;dependency&amp;gt;

         &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;

         &amp;lt;artifactId&amp;gt;spring-boot-starter-test&amp;lt;/artifactId&amp;gt;

         &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;

      &amp;lt;/dependency&amp;gt;

   &amp;lt;/dependencies&amp;gt;

   &amp;lt;build&amp;gt;

      &amp;lt;plugins&amp;gt;

         &amp;lt;plugin&amp;gt;

            &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;

            &amp;lt;artifactId&amp;gt;spring-boot-maven-plugin&amp;lt;/artifactId&amp;gt;

         &amp;lt;/plugin&amp;gt;

      &amp;lt;/plugins&amp;gt;

   &amp;lt;/build&amp;gt;

&amp;lt;/project&amp;gt;&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;span face=&quot;Calibri, sans-serif&quot; style=&quot;font-size: 11pt;&quot;&gt;&lt;pre style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;&quot;&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot 2 REST API configuration&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This class is a JAVA configuration class marked with the
annotation @Configuration. It enables Spring MVC and declares that our
endpoints supports all the hTTP methods (GET, POST, PUT, DELETE, PATCH).&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The code of the configuration class is the following&amp;nbsp;:&lt;/p&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebConfig {

  @Bean
  public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurerAdapter() {
      @Override
      public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping(&quot;/**&quot;)
          .allowedMethods(&quot;GET&quot;, &quot;PUT&quot;, &quot;POST&quot;, &quot;DELETE&quot;, &quot;PATCH&quot;);
      }
    };
  }
}
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot 2 REST API model&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In this &lt;b&gt;spring boot rest api example&lt;/b&gt;, we use two classes
as our model&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The Todo class&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;The TodoListResponse class&amp;nbsp;: it represent
the response of Getting all the Todos endpoint&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The source code of those classes is the following&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot;&gt;package com.javasneo.todolist.model;

public class Todo {

  private int id;
  private String name;
  private String description;

  public Todo() {
  }

  public Todo(int id, String name, String description) {
    this.id = id;
    this.name = name;
    this.description = description;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public String getDescription() {
    return description;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setDescription(String description) {
    this.description = description;
  }
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;TodoListResponse.java&lt;/b&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist.model;

import java.util.ArrayList;

public class TodoListResponse {

  private ArrayList&lt;todo&gt; todos;

  public ArrayList&lt;todo&gt; getTodos() {
    return todos;
  }

  public void setTodos(ArrayList&lt;todo&gt; todos) {
    this.todos = todos;
  }
}
&lt;/todo&gt;&lt;/todo&gt;&lt;/todo&gt;&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot 2 REST API controller&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;This controller presents the four REST endpoints that we
spoke about above.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The data in this REST API controller is stored in an
ArrayList that we initialize in the controller ‘s constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;pre style=&quot;background: white;&quot;&gt;In order to make a controller as a REST controller, we annotate it using @RestController and in order to mark a method in the controller as a REST endpoint we annotate it using @RequestMapping annotation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;In the @RequestMapping annotation, we indicate the http method used by that endpoint.&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;In order to generate an id for a newly added Todo, the controller uses a static variable called id that it increments for the newly created Todo.&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;The source code of the REST controller is the following&amp;nbsp;:&lt;/pre&gt;

&lt;pre class=&quot;code-box short-b&quot;&gt;package com.javasneo.todolist.controller;

import com.javasneo.todolist.model.Todo;
import com.javasneo.todolist.model.TodoListResponse;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

/**
 * Created by Abderrahmen on 31/01/2018.
 */
@RestController
@RequestMapping(&quot;/todos&quot;)
@CrossOrigin()
public class TodoController {

  ArrayList&amp;lt;todo&amp;gt; todos;

  static int id = 0;

  public TodoController(){
    this.todos = new ArrayList&amp;lt;&amp;gt;();
    this.todos.add(new Todo(id++,&quot;my first todo&quot;,&quot;my first todo description&quot;));
    this.todos.add(new Todo(id++, &quot;my second todo&quot;,&quot;my second todo description&quot;));
    this.todos.add(new Todo(id++, &quot;my third todo&quot;,&quot;my third todo description&quot;));

  }

  @RequestMapping(method = RequestMethod.GET)
  public TodoListResponse todos (){
    TodoListResponse todoListResponse = new TodoListResponse();
    todoListResponse.setTodos(this.todos);

    return todoListResponse;
  }

  @RequestMapping(method = RequestMethod.POST)
  public Todo addtodo (@RequestBody Todo todo){
    todo.setId(++id);
    this.todos.add(todo);
    return todo;
  }


  @RequestMapping(method = RequestMethod.PUT)
  public Todo updateTodo (@RequestBody Todo todo){

    for(int i =0; i &amp;lt; this.todos.size(); i++){

      if(this.todos.get(i).getId()  == todo.getId()){
        this.todos.get(i).setName(todo.getName());
        this.todos.get(i).setDescription(todo.getDescription());
        break;
      }
    }
    return todo;
  }

  @RequestMapping(value=&quot;/{id}&quot;, method = RequestMethod.DELETE)
  public void deleteTodo (@PathVariable(&quot;id&quot;) int id){

    for(int i =0; i &amp;lt; this.todos.size(); i++){

      if(this.todos.get(i).getId()  == id){
        this.todos.remove(i);
        break;
      }
    }
  }

}
&lt;/pre&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Spring Boot 2 REST API main Class&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The main class is the entry point of any Spring boot
application. The code of that main class is very simple an is the following&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;package com.javasneo.todolist;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TodoListApplication {

 public static void main(String[] args) {
  SpringApplication.run(TodoListApplication.class, args);
 }&lt;br /&gt;
}
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Invoking Spring Boot 2 Rest API endpoints&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In this section, we invoke all the REST API endpoints using
Postman. You can install postman using this &lt;a href=&quot;https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en&quot;&gt;link&lt;/a&gt;.
In order to use this section, you need to run the TodoListApplication class.
Otherwise the REST endpoints will be down.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;HTTP GET /todos&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The Request is the following&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRT3Y5tBs5jrzjDUJpB2bWcZT4vwmGRjZKKLEpbaSqEKDVFbCEguPV15x7XEnd5yrLHBAR7-UJhx7EjYTU7AMDe-asr4o2_GSIKtGdq_pm-FWYG17c01UETKuooIPUa37TGo-58jF7vjc/s1920/Spring-Boot-REST-API-GET.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring Boot REST API GET&quot; border=&quot;0&quot; data-original-height=&quot;1006&quot; data-original-width=&quot;1920&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRT3Y5tBs5jrzjDUJpB2bWcZT4vwmGRjZKKLEpbaSqEKDVFbCEguPV15x7XEnd5yrLHBAR7-UJhx7EjYTU7AMDe-asr4o2_GSIKtGdq_pm-FWYG17c01UETKuooIPUa37TGo-58jF7vjc/w400-h210/Spring-Boot-REST-API-GET.jpg&quot; title=&quot;Spring Boot REST API GET&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Here, we just add the url of our REST GET endpoint in
Postman. The URL is the following&amp;nbsp;: localhost:8080/todos&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Initially, the endpoint returns the Todo list manually
created in the controller. But, the list gets updated when we use the other REST
endpoints.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;HTTP POST /todos&lt;/b&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;







&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;Here, we add the following Todo object to the TodoList&amp;nbsp;:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;{
	&quot;name&quot;: &quot;added todo&quot;,
	&quot;description&quot;: &quot;added todo description&quot;
} 
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The rest endpoint returns the newly added Todo in the response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisZftXHwxveicVoOh_XKI7KGeWEcY3YWlGWOg25ymzXHgmNwJnomH9-D3dBCoJ0Q2Zl2LSCgPqMsIG3zpcV-wIkc9xhLaJL9vaTDFFyXO7e4CNYDsL-pAvCF_ck5WX9FGgwsB7C-wfO5A/s1920/Spring-Boot-REST-API-POST.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring Boot REST API POST&quot; border=&quot;0&quot; data-original-height=&quot;1006&quot; data-original-width=&quot;1920&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisZftXHwxveicVoOh_XKI7KGeWEcY3YWlGWOg25ymzXHgmNwJnomH9-D3dBCoJ0Q2Zl2LSCgPqMsIG3zpcV-wIkc9xhLaJL9vaTDFFyXO7e4CNYDsL-pAvCF_ck5WX9FGgwsB7C-wfO5A/w400-h210/Spring-Boot-REST-API-POST.jpg&quot; title=&quot;Spring Boot REST API POST&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;HTTP PUT /todos&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Here, we update the which id is equal to zero. In fact, we replace
the Todo object which id is equal to zero with another object and we keep the
same id (zero).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;If we want to implement the partial update of the object, we
should use the PATCH http method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;So, here we replace the original object at index 0 with this
object&amp;nbsp;:&lt;/p&gt;&lt;/div&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;{
	&quot;id&quot;:0,
	&quot;name&quot;: &quot;modified first todo&quot;,
	&quot;description&quot;: &quot;first todo description&quot;
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;This REST endpoint returns the modified Todo object&amp;nbsp;as
shown in the image below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxDksNcrhBa2z8-qbVqt_RoQzm_r2r7hBBSGijzf73wwpH-PQ0H276kR96OGGeLCk-M30ydpE6IVckB7DtJBu89te1xmwC2QdO4CQJpEBl48vszMb0mSCHPRBUisfql8_GkI4iBu3aB5Y/s1920/Spring-Boot-REST-API-PUT.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring Boot REST API PUT&quot; border=&quot;0&quot; data-original-height=&quot;1006&quot; data-original-width=&quot;1920&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxDksNcrhBa2z8-qbVqt_RoQzm_r2r7hBBSGijzf73wwpH-PQ0H276kR96OGGeLCk-M30ydpE6IVckB7DtJBu89te1xmwC2QdO4CQJpEBl48vszMb0mSCHPRBUisfql8_GkI4iBu3aB5Y/w400-h210/Spring-Boot-REST-API-PUT.jpg&quot; title=&quot;Spring Boot REST API PUT&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3 style=&quot;background: white; text-align: left;&quot;&gt;&lt;b&gt;&lt;span face=&quot;Calibri, sans-serif&quot; style=&quot;font-size: 11pt;&quot;&gt;HTTP DELETE /todo/{id}&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This REST endpoint deletes the Todo object present at the id
put in the URL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;To delete the Todo at the index 0, we invoke this url&amp;nbsp;:
localhost:8080/todos/0&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;You may guess the URL to invoke the delete the Todo at the
index 1&amp;nbsp;: localhost:8080/todos/1&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This endpoint returns a 200 OK response for the moment. But
we can return a no content response instead if we want.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;











&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We just want to be as simple as possible because we will use
this REST api to build a fullstack Angular application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdZOhuyKKJRcUOhpwJycoMnWXAYjF0tO_jevKw1xV1uPjn3Zec8otYj2CC5-wNHExcV7COc0KLnNnDXroPFGhhyphenhyphenMurmuSc0UoK0xBq26q529B-9T8flF1TAx-HJSJ3dCtW3hdUjXPW1ow/s1920/Spring-Boot-REST-API-DELETE.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring Boot REST API DELETE&quot; border=&quot;0&quot; data-original-height=&quot;1006&quot; data-original-width=&quot;1920&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdZOhuyKKJRcUOhpwJycoMnWXAYjF0tO_jevKw1xV1uPjn3Zec8otYj2CC5-wNHExcV7COc0KLnNnDXroPFGhhyphenhyphenMurmuSc0UoK0xBq26q529B-9T8flF1TAx-HJSJ3dCtW3hdUjXPW1ow/w400-h210/Spring-Boot-REST-API-DELETE.jpg&quot; title=&quot;Spring Boot REST API DELETE&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Conclusion&amp;nbsp;:&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This &lt;b&gt;spring boot rest api example &lt;/b&gt;arrives at its end.
The next step is to use a real database. As a first step, we will use an in
memory database like H2. Then, we will move to using hibernate and a nosql database
like MongoDB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In the final step, we will build the frontend part of the
app using Angular, react and Vue JS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;So, keep tuned and give as a like and share this tutorial to
spread the knowledge.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We share our tutorial in our &lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt; Facebook page and the source code can be found at &lt;b&gt;&lt;a href=&quot;https://github.com/abenmariem/spring-boot-2-rest-api-arrayList&quot; target=&quot;_blank&quot;&gt;abderrahmen ben mariem&lt;/a&gt;&lt;/b&gt; Github.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;









&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;You may also check our &lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt; or the other &lt;a href=&quot;https://javasneo.blogspot.com/search/label/Spring%20boot2&quot; target=&quot;_blank&quot;&gt;spring boot 2 tutorials&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;

</description><link>https://javasneo.blogspot.com/2020/12/spring-boot-rest-api-example-tutorial-javasneo.html.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRIPfn0knOlAtIhSB4wWh-cRjNeU0ok_UJ5ZrIJhxSUzFsjwbhaJDG85S5NQnJTlHzCBzi3apuK7Ce7PAe2fEa4MdE7Q9aVc-1FxPBKQzZBfejRIzhtpF2dCBJLcWh26_yXm8ZLxtqi-0/s72-w640-h392-c/spring-boot-rest-api-example.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-5475908343481885661</guid><pubDate>Sat, 05 Dec 2020 15:32:00 +0000</pubDate><atom:updated>2020-12-05T16:52:11.750+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">best react book 2020</category><category domain="http://www.blogger.com/atom/ns#">best react books</category><category domain="http://www.blogger.com/atom/ns#">best react books 2020</category><title>Best React Books in 2020 | Best Programming Books</title><description>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 18pt;&quot;&gt;In this post, we will present an up to date list of &lt;/span&gt;&lt;b style=&quot;background-color: white; color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 18pt;&quot;&gt;best react books&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 18pt;&quot;&gt;
for learning React JS.&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;These &lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;best react books&lt;/i&gt; cover the
latest features of react and are selected as the best sold books.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;So, I advise you to check these &lt;i&gt;react books&lt;/i&gt; in order to enhance your
skills in react.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1; text-align: center;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;&lt;a href=&quot;https://amzn.to/33MPfc7&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Learning React&amp;nbsp;: &lt;o:p&gt;&lt;/o:p&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; text-align: center;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;&lt;a href=&quot;https://amzn.to/33MPfc7&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;

&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 18pt; line-height: 115%;&quot;&gt;Modern
Patterns for Developing React Apps&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;If you want to learn how to build efficient React applications, this is
your book. Ideal for web developers and software engineers who understand how
JavaScript, CSS, and HTML work in the browser, this updated edition provides
best practices and patterns for writing modern React code. No prior knowledge
of React or functional programming is necessary. Authors Alex Banks and Eve
Porcello show you how to create UIs that can deftly display changes without
page reloads on large-scale data-driven websites. You&#39;ll also discover how to
work with functional programming and the latest ECMAScript features. Once you
learn how to build React components with this hands-on guide, you&#39;ll understand
just how useful React can be in your organization. Understand key functional
programming concepts with JavaScript Look under the hood to learn how React
runs in the browser Create application presentation layers with React
components Manage data and reduce the time you spend debugging applications
Explore React&#39;s component lifecycle to improve UI performance Use a routing
solution for single-page application features Learn how to structure React
applications with servers in mind.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://amzn.to/33MPfc7&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;499&quot; data-original-width=&quot;381&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKWhUiu9gvAPMIYguOstvEu3rPPjJdSBQUR50NuiwIwK-nf6qTeyt75d9FZK_lGx1dH-jVwHHdh6pUPqAkwJ369wGoQT6P2WRHQMLnUmtjvRgCu7bUc5LpD0c-VvcgVC-dpb0t2L-ooR8/w305-h400/best_react_books_1.jpg&quot; width=&quot;305&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin: 9pt 0cm 4.5pt -11.25pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-size: 15pt; line-height: 115%;&quot;&gt;Book
Details&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 18pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Item Weight :&amp;nbsp;1.09 pounds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Paperback :&amp;nbsp;310 pages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ISBN-10 :&amp;nbsp;1492051721&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ISBN-13 :&amp;nbsp;978-1492051725&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Dimensions :&amp;nbsp;7.01 x 0.65 x 9.17 inches&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Publisher :&amp;nbsp;O&#39;Reilly Media; 2nd edition (June 30, 2020)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 4.15pt; margin-left: 49.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #111111; font-family: Symbol; font-size: 10.0pt; mso-bidi-font-family: Symbol; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Symbol; mso-fareast-language: FR;&quot;&gt;·&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #111111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Language: :&amp;nbsp;English&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.25pt; margin-bottom: 0cm; margin-left: -18.0pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;About
the Author&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;



















&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;Alex Banks&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt; and &lt;b&gt;Eve
Porcello&lt;/b&gt; are software engineers, authors, and trainers. With their company
Moon Highway, theyâ??ve taught JavaScript, Node, React, and GraphQL courses to
engineers all over the world. They have also created videos and authored
training content for OReilly, LinkedIn Learning, and egghead.io.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-outline-level: 1; text-align: center;&quot;&gt;&lt;a href=&quot;https://amzn.to/33K1qpW&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;React Explained: Your
Step-by-Step Guide&lt;br /&gt; &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #111111; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 18.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR; mso-font-kerning: 18.0pt;&quot;&gt;to React (2020 Edition)&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;



&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;In React Explained, readers
will dig deep into how React works and will learn how to build applications
with it. While the focus is on building for the frontend on the web, many of
the skills you will learn will also apply to writing React on the server side,
for native applications and even for Virtual Reality environments.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://amzn.to/33K1qpW&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;386&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZBs7ERVKBhlCHMqtxJ5-ud35oaOgsV4Nzgmrd1dNYumtqvYqnHFBgdGXOPA-vbRK2hpadbfbS2ijH_2i0mHY528hqb8ZKxS3AAcU07KOieK3uW83Ljn1QY6WUUoKlRXQwWdPZbEFszrM/w309-h400/best_react_books_2.jpg&quot; width=&quot;309&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin: 9pt 0cm 4.5pt -11.25pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Book
Details&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Publication date :&amp;nbsp;March
     5, 2019&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;File size :&amp;nbsp;3658 KB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Word Wise :&amp;nbsp;Not Enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Print length :&amp;nbsp;371 pages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Publisher :&amp;nbsp;OS Training,
     LLC (March 5, 2019)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Language: :&amp;nbsp;English&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ASIN :&amp;nbsp;B07PHQZJQ5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.25pt; margin-bottom: 0cm; margin-left: -18.0pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;About
the Author&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;Zac Gordon&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt; is a professional educator, who currently
focuses on JavaScript development with and alongside WordPress at
javascriptforwp.com. Zac has years of experience teaching at high schools,
colleges, bootcamps and online learning sites like Treehouse, Udemy and
Frontend Masters. In addition to teaching, Zac also runs Web Hosting for
Students, one of the world’s largest hosting companies dedicated to students
and teachers. You can also catch his free Office Yoga sessions on OfficeYoga.tv.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Table
of Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;1.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;The Javascript You
Should Know for React&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;2.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Helpful Developer
Tools for React&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;3.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;A High Level Overview
of React&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;4.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;React Elements and
Components Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;5.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;5 Exercises in Writing
React With Elements and Components&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;6.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;JSX Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;7.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;5 Exercises in Writing
React With JSX&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;8.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Create React App
Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;9.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;5 Exercises With
Create React App&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;10.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Props in React
Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;11.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;5 Exercises in Working
With Props&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;12.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;State in React
Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;13.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;5 Exercises in Working
With State&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;14.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;The Component
Lifecycle Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;15.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;5 Exercises With the
Component Lifecycle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;16.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Context Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;17.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;React Hooks Explained&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;18.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Exercises with Hooks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;19.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Project Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;20.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 1 - Listing
Content from State&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;21.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 2 - Routing and
Single Content Views&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;22.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 3 - Adding a
Content Form&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;23.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 4 - Adding Flash
Messages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;24.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 5 - Updating
Content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;25.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 6 - Deleting
Content&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;26.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 7 - Maintaining
Persistent State With Local Storage&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;27.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 8 -
Authenticating With a Firebase Database&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;28.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 9 - CRUD and Live
Syncing With Firebase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;29.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Step 10 - Deploying
the Project&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;span style=&quot;color: #888888; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;30. Step 11 - Refactoring Your
Code&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background: white; line-height: 27.0pt; margin-top: 0cm; text-align: center;&quot;&gt;&lt;span class=&quot;a-size-extra-large&quot;&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 21.0pt;&quot;&gt;&lt;a href=&quot;https://amzn.to/3gdEh4o&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;React and React Native: Acomplete hands-on guide to modern web and mobile development with React.js, 3rdEdition&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;

&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #333333; font-size: 10.5pt; line-height: 115%;&quot;&gt;This book is for any
JavaScript developer who wants to start learning how to use Facebook&#39;s UI
libraries, React and React Native, for mobile and web application development.
Although no prior knowledge of React is needed, working knowledge of JavaScript
programming will help you understand the concepts covered in the book more
effectively.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://amzn.to/3gdEh4o&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;406&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFkXXPzoJVa_Jz0-3-ahRzPTHPn5geulMCjP9kPVRt_jWGqbrzKxi7AZ_sStaijMg1-wJszD0cw9uctCZBv7I3gEd0wA3EEZZnu_3Dlff2jLk2k97f0Mgbhao4kVxVGuzG8wQnNNOWvq8/w325-h400/best_react_books_3.jpg&quot; width=&quot;325&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin: 9pt 0cm 4.5pt -11.25pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Book
Details&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Item Weight :&amp;nbsp;1.97 pounds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Paperback :&amp;nbsp;526 pages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ISBN-10 :&amp;nbsp;1839211148&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ISBN-13 :&amp;nbsp;978-1839211140&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Dimensions :&amp;nbsp;7.5 x 1.19 x
     9.25 inches&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Publisher :&amp;nbsp;Packt
     Publishing (April 30, 2020)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Language: :&amp;nbsp;English&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.25pt; margin-bottom: 0cm; margin-left: -18.0pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;About
the Author&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 10.5pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Adam Boduch&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&amp;nbsp;has been involved in large-scale JavaScript development for nearly 10
years. Before moving to the frontend, he worked on several large-scale cloud
computing products using Python and Linux. No stranger to complexity, Adam has
practical experience with real-world software systems and the scaling
challenges they pose. He is the author of several JavaScript and React books
and is passionate about innovative user experiences and high performance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 10.5pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Roy Derks&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;&amp;nbsp;is a serial start-up CTO, conference speaker, and developer from
Amsterdam. He has been actively programming since he was a teenager, starting
as a self-taught programmer using online tutorials and books. At the age of 14,
he founded his first start-up, a peer-to-peer platform where users could trade
DVDs with other users for free. This marked the start of his career in web
development, which back then primarily consisted of creating web applications
using an MVC architecture with the LAMP stack.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;In 2015, he was
introduced to React and GraphQL at a hackathon in Berlin, and after winning a
prize for his project, he started to use these technologies professionally.
Over the next few years, he helped multiple start-ups create cross-platform
applications using React and React Native, including a start-up that he co-founded.
He also started giving workshops and talks at conferences around the globe. In
2019, he gave over 20 conference talks about React, React Native, and GraphQL,
inspiring over 10,000 developers worldwide.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Table
of Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;1.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Why React?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;2.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Rendering with JSX&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;3.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Component Properties,
State, and Context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;4.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Getting Started with
Hooks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;5.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Event Handling - The
React Way&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;6.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Crafting Reusable
Components&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;7.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;The React Component
Life Cycle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;8.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Validating Component
Properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;9.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Handling Navigation
with Routes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;10.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Code Splitting Using
Lazy Components and Suspense&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;11.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Server-Side React
Components&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;12.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;User Interface
Framework Components&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;13.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Why React Native?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;14.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Kick-Starting React
Native Projects&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;15.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Building Responsive
Layouts with Flexbox&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;16.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Navigating Between
Screens&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;17.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Rendering Item Lists&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;18.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Showing Progress&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;19.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Geolocation and Maps&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;20.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Collecting User Input&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;21.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Displaying Modal
Screens&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;22.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Responding to User
Gestures&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;23.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Controlling Image
Display&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;24.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Going Offline&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;25.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Native UI Components
Using NativeBase&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;26.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Handling Application
State&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;27.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Why Apollo?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;







































































&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;28.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Building an Apollo
React App&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background: white; line-height: 27pt; margin-top: 0cm; text-align: center;&quot;&gt;&lt;span class=&quot;a-size-extra-large&quot;&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 21.0pt;&quot;&gt;&lt;a href=&quot;https://amzn.to/3gdiJox&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Learning React js: Learn React JS From Scratch with Hands-OnProjects , 2nd Edition&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background: white; margin-top: 0cm;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial, sans-serif; font-size: 10.5pt; font-weight: normal; line-height: 115%;&quot;&gt;In
this book, we take you on a fun, hands-on and pragmatic journey to master React
from a web development point of view. You&#39;ll start building React apps within
minutes. Every section is written in a bite-sized manner and straight to the
point as I don’t want to waste your time (and most certainly mine) on the
content you don&#39;t need. In the end, you will have what it takes to develop a
real-life app.&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://amzn.to/3gdiJox&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;353&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj58mMOEIOONWVl59bB55wqfJVB4nZwMS9zmWeDevh5lbsurSXp0lkAVgNXdF6V8QGFOKSDGvNwepl3Ko1PSg7xJXEYk5pWYDpYHjDiEX0D9AOwQgKxSCkPYUZT6DtBslNapWNlrQWBqBY/w283-h400/best_react_books_4.jpg&quot; width=&quot;283&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin: 9pt 0cm 4.5pt -11.25pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Book
Details&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Publication date :&amp;nbsp;October
     2, 2020&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;File size :&amp;nbsp;450 KB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Print length :&amp;nbsp;115 pages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Word Wise :&amp;nbsp;Not Enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Language: :&amp;nbsp;English&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ASIN :&amp;nbsp;B08KNW41JB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background: white; line-height: 27.0pt; margin-top: 0cm; text-align: center;&quot;&gt;&lt;span class=&quot;a-size-extra-large&quot;&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 21.0pt;&quot;&gt;&lt;a href=&quot;https://amzn.to/2JCO3kI&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Full-Stack React Projects: LearnMERN stack development by building modern web apps using MongoDB, Express,React, and Node.js, 2nd Edition&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;This is one of the most
useful web development books for JavaScript developers who may have worked with
React but have minimal experience in full-stack development with Node, Express,
and MongoDB.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://amzn.to/2JCO3kI&quot; imageanchor=&quot;1&quot; rel=&quot;nofollow&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;406&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJjZi5dsSEEhQtKYMnqPL2mM8_h8_OmYZet24NhofvtTHh1DeJj3DPN9qZo6LmkzKGaQ7q4mHphsj-U9DC4NaRrTiywTBxsfJK-JERCrdapXR_j6zct1bO5dJ8iPwc1o_TrHxihasr9_8/w325-h400/best_react_books_5.jpg&quot; width=&quot;325&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Book
Details&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Item Weight :&amp;nbsp;2.66 pounds&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Paperback :&amp;nbsp;716 pages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ISBN-10 :&amp;nbsp;1839215410&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;ISBN-13 :&amp;nbsp;978-1839215414&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Dimensions :&amp;nbsp;7.5 x 1.62 x
     9.25 inches&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Publisher :&amp;nbsp;Packt
     Publishing (April 17, 2020)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;background: white; color: #111111; line-height: normal; margin-bottom: 4.15pt; mso-list: l1 level1 lfo1; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Language: :&amp;nbsp;English&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;About
the Author&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;Shama Hoque has more than 9
years of experience as a software developer and mentor, with a Master’s in
Software Engineering from Carnegie Mellon University.&lt;/span&gt;&lt;span style=&quot;color: #0f1111; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;
&lt;span style=&quot;background: white;&quot;&gt;From Java programming to full-stack development
with JavaScript, the applications she has worked on include national Olympiad
registration websites, universally accessible widgets, video conferencing apps,
and medical 3D reconstruction software.&lt;/span&gt;&lt;br style=&quot;box-sizing: border-box;&quot; /&gt;
&lt;span style=&quot;background: white;&quot;&gt;Currently, she makes web-based prototypes for
R&amp;amp;D start-ups in California, while training aspiring software engineers and
teaching web development to CS undergrads in Bangladesh.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background: white; margin-bottom: 4.5pt; margin-left: -11.25pt; margin-right: 0cm; margin-top: 9.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 15.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Table
of Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;1.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Unleashing React
Applications with MERN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;2.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Preparing the
Development Environment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;3.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Building a Backend
with MongoDB, Express, and Node&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;4.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Adding a React
Frontend to Complete MERN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;5.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Growing the Skeleton
into a Social Media Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;6.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Building a Web-Based
Classroom Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;7.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Exercising MERN Skills
with an Online Marketplace&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;8.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Extending the
Marketplace for Orders and Payments&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;9.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Adding Real-Time
Bidding Capabilities to the Marketplace&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;10.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Integrating Data
Visualization with an Expense Tracking Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;11.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Building a Media
Streaming Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;12.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Customizing the Media
Player and Improving SEO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;13.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Developing a Web-Based
VR Game&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;14.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Making the VR Game
Dynamic Using MERN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 115%;&quot;&gt;





































&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; margin-left: 52.5pt; margin-right: 0cm; margin-top: 0cm; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: Arial; mso-fareast-language: FR;&quot;&gt;15.&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;color: #888888; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;Following Best
Practices and Developing MERN Further&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0f1111; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/12/best-react-books.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKWhUiu9gvAPMIYguOstvEu3rPPjJdSBQUR50NuiwIwK-nf6qTeyt75d9FZK_lGx1dH-jVwHHdh6pUPqAkwJ369wGoQT6P2WRHQMLnUmtjvRgCu7bUc5LpD0c-VvcgVC-dpb0t2L-ooR8/s72-w305-h400-c/best_react_books_1.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-2604696057029864699</guid><pubDate>Fri, 04 Dec 2020 20:56:00 +0000</pubDate><atom:updated>2020-12-04T21:59:23.864+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><category domain="http://www.blogger.com/atom/ns#">java substring</category><category domain="http://www.blogger.com/atom/ns#">string java substring</category><category domain="http://www.blogger.com/atom/ns#">substring in java</category><category domain="http://www.blogger.com/atom/ns#">substring java</category><title>Substring in java | java beginners tutorial</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGtawzWwsTVdjDnvrQdfFNGJmamYx9uDFI9lZCUmP-urxHZ6ldbXqPmsrtcEbdNdi8Smx804q8PuTO_3Mc5cURQORQp_kBxRe5fZaOpQ8EjqUcYAe29-IfAarT_UQAwQvMLao03_a-Giw/s522/substring-in-java.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGtawzWwsTVdjDnvrQdfFNGJmamYx9uDFI9lZCUmP-urxHZ6ldbXqPmsrtcEbdNdi8Smx804q8PuTO_3Mc5cURQORQp_kBxRe5fZaOpQ8EjqUcYAe29-IfAarT_UQAwQvMLao03_a-Giw/w400-h245/substring-in-java.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Substring in java&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Substring is a method in the String class that allows to get
a subset of a String.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Substring in java methods&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;There are two methods offered by the String class that
return a substring&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span face=&quot;&amp;quot;Verdana&amp;quot;,sans-serif&quot; style=&quot;color: black; font-size: 10pt; line-height: 107%; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;public
String substring(int startIndex)&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span face=&quot;&amp;quot;Verdana&amp;quot;,sans-serif&quot; style=&quot;color: black; font-size: 10pt; line-height: 107%; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;this method returns a
new string that starts from startIndex inclusive and finishes at the original
string’s last index inclusive also (the last index of the original string is at
the index originalString.length() -1 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span face=&quot;&amp;quot;Verdana&amp;quot;,sans-serif&quot; style=&quot;color: black; font-size: 10pt; line-height: 107%; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: FR;&quot;&gt;substring
in java example 1&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; margin-bottom: 0cm; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;color: black; mso-color-alt: windowtext;&quot;&gt;The substring
example below displays the substring of the string «&amp;nbsp;abderrahmen&amp;nbsp;»
beginning from the index 4 inclusive and finishing at the last index of that
string (10 = 11-1)&lt;/span&gt;&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot;&gt;

public class substring {

  public static void main(String[] args){
    String myString = &quot;abderrahmen&quot;;
    String substring = myString.substring(4);
    System.out.println(substring);

  }
}
&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span face=&quot;Verdana, sans-serif&quot; style=&quot;font-size: 10pt; line-height: 107%;&quot;&gt;The output of the codeabove is the following&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span face=&quot;Verdana, sans-serif&quot; style=&quot;font-size: 10pt; line-height: 107%;&quot;&gt;rrahmen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span face=&quot;Verdana, sans-serif&quot; style=&quot;font-size: 10pt; line-height: 107%;&quot;&gt;public String substring(int startIndex, int endIndex)&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span face=&quot;Verdana, sans-serif&quot; style=&quot;font-size: 10pt; line-height: 107%;&quot;&gt;This method returns a new string &lt;/span&gt;beginning from a starting index and finishing at a final
index. (the caracter at the final index is excluded from the resulting string )&lt;span face=&quot;Verdana, sans-serif&quot; style=&quot;font-size: 10pt; line-height: 107%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Substring in java example 2&lt;/b&gt;&lt;/p&gt;&lt;span face=&quot;&amp;quot;Calibri&amp;quot;,sans-serif&quot; style=&quot;font-size: 11pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;The substring example below displays the substring of the string «&amp;nbsp;abderrahmen&amp;nbsp;» beginning from the index zero and
finishing at the index three (the caracter at the index 3 is excluded).&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;public class substring {

  public static void main(String[] args){
    String myString = &quot;abderrahmen&quot;;
    String substring = myString.substring(0, 3);
    System.out.println(substring);

  }
}
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;The displayed string is the following&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;abd&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;


&lt;div&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-theme-font: minor-bidi;&quot;&gt;This core JAVA tutorial which deals with the
substring method in java arrives at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-theme-font: minor-bidi;&quot;&gt;To check the other JAVA tutorials, please
check our &lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;core java&lt;/b&gt;&amp;nbsp;&lt;b&gt;tutorial&lt;/b&gt;&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;Please, don’t forget to follow us on &lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Facebook&lt;/b&gt; &lt;/a&gt;to get our next JAVA core tutorial.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://javasneo.blogspot.com/2020/12/substring-in-java-tutorial.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGtawzWwsTVdjDnvrQdfFNGJmamYx9uDFI9lZCUmP-urxHZ6ldbXqPmsrtcEbdNdi8Smx804q8PuTO_3Mc5cURQORQp_kBxRe5fZaOpQ8EjqUcYAe29-IfAarT_UQAwQvMLao03_a-Giw/s72-w400-h245-c/substring-in-java.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-1862128476285511053</guid><pubDate>Sat, 27 Jun 2020 12:59:00 +0000</pubDate><atom:updated>2020-12-05T19:08:47.953+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cast class java</category><category domain="http://www.blogger.com/atom/ns#">cast object java</category><category domain="http://www.blogger.com/atom/ns#">casting in java</category><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><category domain="http://www.blogger.com/atom/ns#">java cast string</category><category domain="http://www.blogger.com/atom/ns#">upcasting java</category><title>Type casting in java with example</title><description>&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdy6sLQbC_9dtDoi-ETyvgiKIiJf9Qz3GLcPHQSkI8nsdEMWREjMAKsZ8kahBqio03Y1RvVyQaKmk5R4pJU3Y1P2L45Tz9aA7EP03vQMzB-6tf2Kk7yjn8aeiLWe7UW-_o-OY-uvXWKSU/s522/casting+in+java+tutorial+for+beginners.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Type Casting in java example&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdy6sLQbC_9dtDoi-ETyvgiKIiJf9Qz3GLcPHQSkI8nsdEMWREjMAKsZ8kahBqio03Y1RvVyQaKmk5R4pJU3Y1P2L45Tz9aA7EP03vQMzB-6tf2Kk7yjn8aeiLWe7UW-_o-OY-uvXWKSU/w400-h245/casting+in+java+tutorial+for+beginners.jpg&quot; title=&quot;Type Casting in java example&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Type casting in java&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt; is used when
assigning a value of type TypeA to a variable of type TypeB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 20.8px;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 20.8px;&quot;&gt;There are two types of&amp;nbsp;&lt;i&gt;casting in java&lt;/i&gt;:&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 20.8px;&quot;&gt;&lt;/p&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 20.8px;&quot;&gt;Implicit casting&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 20.8px;&quot;&gt;Explicit casting&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;If you don’t know
how to use java variables, please check our corresponding&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-variables-for-beginners-tutorial.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;java variables tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Each variable has
a type in java.&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Each data type
has a size (number of bits used by that type).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;byte &amp;lt; short
&amp;lt; (char)&amp;lt; int &amp;lt; long &amp;lt; float &amp;lt; double&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Each data type
has a range of values that it can hold. This range of values is based on the
size of the data type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The byte, long,
float and double are signed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The char type is unsigned.
We cannot assign a byte or a short to a char and vice versa.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Casting example in java&lt;/h2&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The size of byte
data type is 8 bits.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The range of
values that can be coded using 8 bits is the following: from 0 to 127.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;We can imagine
that each type is a bag. The bags are of different sizes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The bag
associated to the byte type is the smallest one.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The bag
associated to the double type is the biggest one.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;A bag can be either
full or partially filled.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 16pt; line-height: 130%;&quot;&gt;Casting in java: problem&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Let’s imagine
that we have a big bag and a small one.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The big bag is
filled up with items.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;What happens when
we put the content of the big bag inside the small one?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The answer is
that we cannot do that.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The same problem
occurs when we try to assign a bigger type value to a smaller type variable.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;int a = 100;
byte b = a;
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Here we try to
assign an int value (the content of the variable a) to a variable of type byte.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;In this case, the
java compiler will complain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;But, w said above
that the byte type can hold the value 100.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Here, the java compiler
complains because there is a chance that the variable a contains a value that
cannot be held by a variable of byte type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;We can imagine here
that the bag associated to the int type is partially filled. But, it can be
totally filled in the future when our app runs.&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;So, we haven’t
made a mistake.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Here where comes
the necessity of casting.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;In fact, we can
use casting here to tell the compiler to trust us and not to complain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The code becomes
like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;int a = 100;
byte b = (byte) a;
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;So, the casting
in java is related to assignment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;It is done by
putting the type of the variable on the left hand side of the assignment
between parentheses.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;span lang=&quot;&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;This is the only way to do casting.&lt;/span&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 16pt; line-height: 130%;&quot;&gt;Implicit casting in java&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;&lt;div&gt;&lt;span lang=&quot;&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;This &lt;b&gt;type of
casting&lt;/b&gt; is performed automatically by the compiler.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;The developer
doesn’t do anything to make &lt;b&gt;implicit casting&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;This is an
example of &lt;i&gt;implicit casting&lt;/i&gt;:&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;char c = ‘a’;
int b = c;
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;In this case, the
compiler converts the character ‘a’ into its ASCHI code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Then, it assigns
this ASCHI code to the variable b.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The implicit
casting is performed when assigning a smaller data type value to a bigger data
type variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;This is called &lt;b&gt;widening
assignment&lt;/b&gt; or &lt;b&gt;upcasting&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Here, we put the content
of a small bag into a big bag. This operation can be done with no problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;There is &lt;b&gt;no
loss of information&lt;/b&gt; when making this operation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 16pt; line-height: 130%;&quot;&gt;Explicit casting in java&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;This type of
casting is performed by the developer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;The &lt;b&gt;explicit
casting&lt;/b&gt; is performed when assigning a bigger data type value to a smaller
data type variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;This is called &lt;b&gt;narrowing
assignment&lt;/b&gt; or &lt;b&gt;downcasting&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;If we don’t
perform the explicit casting, we will get a compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;Here, we put the
content of a big bag into a small bag. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;This operation is
problematic because it may cause &lt;b&gt;a loss of information&lt;/b&gt; when making.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;This is why we
have to perform the &lt;b&gt;java cast&lt;/b&gt; in this situation.&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 14pt; line-height: 130%;&quot;&gt;Explicit casting example&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;color: black; font-size: 12pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;This is the same
example mentioned above:&lt;/span&gt;&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;int a = 100;
byte b = (byte) a;
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;Explicit casting problem&lt;/h3&gt;&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;If we don’t use
the &lt;b&gt;explicit casting&lt;/b&gt; wisely, we may cause a loss of information:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;int x = 128;
byte b = (byte) x;
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;b will get the
value -127 which is incorrect. The maximum value that can be held by a byte is
128.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 16pt; line-height: 130%;&quot;&gt;Not allowed casts in JAVA&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;int x = 20;
boolean b = (boolean) x;
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;We cannot cast a
numerical type to a boolean type and vice versa.&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;int x = 20;
String s = (String) x; -&amp;gt; compiler error
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;We cannot cast a
numeric type to a String type and vice versa.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;line-height: 130%; text-align: left;&quot;&gt;&lt;b style=&quot;text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 16pt; line-height: 130%;&quot;&gt;The cast in JAVA has high precedence&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;byte b = (byte) 124 - 20;
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;The 124 is cast
to a byte type then the 124 is promoted to int.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;The whole
expression in the right is of type int. We cannot assign an int to a byte
without cast.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;The solution is
the following:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;byte b = (byte) (124 - 20);
&lt;/pre&gt;
&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;This java
tutorial which deals with the&amp;nbsp;&lt;b&gt;java casting&lt;/b&gt;&amp;nbsp;arrives at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: 130%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;To check the
other tutorials that deal with core java, please check our&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;core java tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;.&lt;br /&gt;
Please, don’t forget to follow us on our&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;a href=&quot;http://www.facebook.com/howtoprograminjava/&quot;&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 130%; mso-ascii-font-family: &amp;quot;Times New Roman&amp;quot;; mso-ascii-theme-font: major-bidi; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-theme-font: major-bidi; mso-font-width: 0%; mso-hansi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-hansi-theme-font: major-bidi;&quot;&gt;how to program&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;Facebook page&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 130%;&quot;&gt;&amp;nbsp;to get our
next java tutorial.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
</description><link>https://javasneo.blogspot.com/2020/06/type-casting-in-java-with-example.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdy6sLQbC_9dtDoi-ETyvgiKIiJf9Qz3GLcPHQSkI8nsdEMWREjMAKsZ8kahBqio03Y1RvVyQaKmk5R4pJU3Y1P2L45Tz9aA7EP03vQMzB-6tf2Kk7yjn8aeiLWe7UW-_o-OY-uvXWKSU/s72-w400-h245-c/casting+in+java+tutorial+for+beginners.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-4264197360864964505</guid><pubDate>Sun, 21 Jun 2020 14:50:00 +0000</pubDate><atom:updated>2020-12-05T19:12:35.756+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">k8s deployment</category><category domain="http://www.blogger.com/atom/ns#">kubectl delete deployment</category><category domain="http://www.blogger.com/atom/ns#">kubernetes deployment</category><category domain="http://www.blogger.com/atom/ns#">kubernetes deployment yaml</category><title>Kubernetes deployment explained with examples</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEIqnX_d_1mYoI_ETqRf_Qdbk6GOF2TwfMP-cbtZC0N8GNDx_Xx-Dm8RYJgxBkHdfH3ojc5KtrL05Ly-BaeKNlU8SxkC1N5q9xODBYrSYHt10VM3gCQh9DmtiZQ9CUokYk0BAtiATEQYU/s578/kubernetes-deployment-tutorial-for-beginners.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes deployment tutorial for beginners&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;578&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEIqnX_d_1mYoI_ETqRf_Qdbk6GOF2TwfMP-cbtZC0N8GNDx_Xx-Dm8RYJgxBkHdfH3ojc5KtrL05Ly-BaeKNlU8SxkC1N5q9xODBYrSYHt10VM3gCQh9DmtiZQ9CUokYk0BAtiATEQYU/w400-h221/kubernetes-deployment-tutorial-for-beginners.png&quot; title=&quot;kubernetes deployment tutorial for beginners&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;A &lt;b&gt;kubernetes deployment&lt;/b&gt; is a kubernetes resource that manages a replicaset which in its turn manages a set of pods. Those pods contain running docker containers.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-hH2-_nvwlXqFpEjidKS6QCOvnKF2v0OTFOA-NrcJs458EpfEZt48CdnTx9jADY-F3_WZvGQhXXMxHPT7Xiu3VOhJcA_Z0ZrOdw3tF48qX7iT4lCs5h1A351bAzL0AYsV43M4vpJKIZU/s1280/kubernetes-deployment-tutorial.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes deployment architecture&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-hH2-_nvwlXqFpEjidKS6QCOvnKF2v0OTFOA-NrcJs458EpfEZt48CdnTx9jADY-F3_WZvGQhXXMxHPT7Xiu3VOhJcA_Z0ZrOdw3tF48qX7iT4lCs5h1A351bAzL0AYsV43M4vpJKIZU/w640-h360/kubernetes-deployment-tutorial.png&quot; title=&quot;kubernetes deployment architecture&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Kubernates deployment use cases:&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;upgrade the docker images seamlessly&amp;nbsp;:&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;if we upgrade them at once, we will have some
downtime of the app. So we need to upgrade them one by one. This is called
rolling update.&lt;/li&gt;&lt;li&gt;Rollback changes&amp;nbsp;: if you make an upgrade to your app
and you make some regression. You can rollback your modification seemlessly.&lt;/li&gt;&lt;/ul&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In production environment, we will not be creating a pod
definition file or a replicaset definition file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;But, we will be creating directly a deployment definition
file.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;If you don&#39;t know what is a &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-pod-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;pod&lt;/a&gt; or a &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-replicaset-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;replicaset&lt;/a&gt;, please feel free to check the correspondant tutorials.&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;o:p&gt;&amp;nbsp;Kubernetes deployment desfinition file example:&lt;/o:p&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;The deployment definition file is similar to the replicaSet definition file except for the kind part which is equal to Deployment in the case of a deployment.&lt;/o:p&gt;&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    tier: backend
spec:
  replicas: 4
  template:
    metadata:
      name: nginx-pod
      labels:
        tier: backend
    spec:
      containers:
        - name: nginx
          image: nginx
  selector:
    matchLabels:
      tier: backend
&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Here the deployment has as name nginx-deployment. It creates a replicaset that creates in its turn 4 pods (replicas = 4) based on the nginx image. The created pods have as label tier: backend and the deployment is configured to manage those pods: the selector is configured to manage the pods that have as label tier:backend.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Kubernetes Deployment&amp;nbsp;: rollout and rollback&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;When a new deployment is created, a new rollout is created
with version 1 (a rollout is the process of deployment of new containers).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;When the container is upgraded, a new Rollout with new
revision is created which is version 2.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;This enables us to rollback to a previous version of the
deployment if necessary.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;You can see the status of the Rollout using this command&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;kubectl rollout status deployment &amp;lt;deployment_name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74mIZ9lRwrN_kBlmd0CIqFkuw9wdF3lhDkiT2KrqS5RBRPHT5k-80M9a6F2Gpp8sAbz61v8ggB4sZfzenmso7cWHm2Oi8DqMG0mYBTmyP5XGe3mjYr5Wom7IGL5oJgj_qly-tJR1sWVI/s1501/kubectl-rollout-status.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl rollout status&quot; border=&quot;0&quot; data-original-height=&quot;70&quot; data-original-width=&quot;1501&quot; height=&quot;30&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74mIZ9lRwrN_kBlmd0CIqFkuw9wdF3lhDkiT2KrqS5RBRPHT5k-80M9a6F2Gpp8sAbz61v8ggB4sZfzenmso7cWHm2Oi8DqMG0mYBTmyP5XGe3mjYr5Wom7IGL5oJgj_qly-tJR1sWVI/w640-h30/kubectl-rollout-status.png&quot; title=&quot;kubectl rollout status&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;To see the revisions and the history of the rollout, we run&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;kubectl rollout history deployment &amp;lt;deployment_name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQDR0JmDFHjWVHqaByiDpRHbk3pe2c5dU7jfoMOU52f_Ah7wVPhv8z8hA1z0wzuRNGGqWPNtWgsKhkn9j7YbsZ1EKbpXmbTbsctVTg4Og7l6r386Ps0uJLDiSoTbK46rS2uuduvDdPXxU/s1501/Kubectl-rollout-history-deployment.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Kubectl rollout history deployment&quot; border=&quot;0&quot; data-original-height=&quot;92&quot; data-original-width=&quot;1501&quot; height=&quot;40&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQDR0JmDFHjWVHqaByiDpRHbk3pe2c5dU7jfoMOU52f_Ah7wVPhv8z8hA1z0wzuRNGGqWPNtWgsKhkn9j7YbsZ1EKbpXmbTbsctVTg4Og7l6r386Ps0uJLDiSoTbK46rS2uuduvDdPXxU/w640-h40/Kubectl-rollout-history-deployment.png&quot; title=&quot;Kubectl rollout history deployment&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;Kubernetes deployment strategies&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;There are two types of deployment strategies&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Destroy all the old containers which are running
the old version of the app and deploying new ones running the new version of
the app&amp;nbsp;: this is called the recreate strategy and this is not the default
strategy -&amp;gt; it incurs a down time of the app&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: Calibri; mso-hansi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Destroy the old containers one by one and create
new container once an old container is destroyed&amp;nbsp;: this strategy is called
Rolling update and its is seamless because there is no down time of the app&lt;/li&gt;&lt;/ul&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to update a deployment, we make the necessary
changes in the deployment description file (changing the container image
version, changing the deployment name, etc). Then we run this command&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;kubectl apply -f deployment-description-file.yml&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Here, i will modify the deployment description file above in order to run nginx:1.19-alpine image instead of nginx:latest image. The deployment definition file becomes like this:&lt;/p&gt;

&lt;pre class=&quot;code-box short-b&quot;&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    tier: backend
spec:
  replicas: 4
  template:
    metadata:
      name: nginx-pod
      labels:
        tier: backend
    spec:
      containers:
        - name: nginx
          image: nginx:1.19-alpine
  selector:
    matchLabels:
      tier: backend
&lt;/pre&gt;



&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK8JXMwnTFH2cxiqAIKq2hO5552shpnALFSCMbTE3EV-_hgupftXiVjFYb9lBINdRNMwpSUckauOz9CvFCFOuZxXAOIRW_GnbZPxckWnVNFBTzrv3Pq2qLSmzYtQbR0npoQWRhbJrxEhU/s1500/kubectl-apply.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl apply&quot; border=&quot;0&quot; data-original-height=&quot;94&quot; data-original-width=&quot;1500&quot; height=&quot;48&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiK8JXMwnTFH2cxiqAIKq2hO5552shpnALFSCMbTE3EV-_hgupftXiVjFYb9lBINdRNMwpSUckauOz9CvFCFOuZxXAOIRW_GnbZPxckWnVNFBTzrv3Pq2qLSmzYtQbR0npoQWRhbJrxEhU/w768-h48/kubectl-apply.png&quot; title=&quot;kubectl apply&quot; width=&quot;768&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Here, i kept the same name of the deployment in order to update the present deployment.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Otherwise, a new deployment will be created.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;When, we upgrade the application, a new replicaset is
created and the pods of the old replicaset are destroyed one by one. Once an
old pod is destroyed, a new one is created in the new replicaset.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSW1YfyAo13NcfufLpAzUWLKb08YIzo3-oIqq3fGtlSOP6C6Y9NrJLV4SmBWXnko9F_GMvGc7flk3rzlysCdbvUOpdIHwnS2MFttBsD_DPU6XBwcNcekid_dPd0mLv_7kmQzMG10rYgE0/s1501/old-recent-replicaset.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl get replicaset&quot; border=&quot;0&quot; data-original-height=&quot;107&quot; data-original-width=&quot;1501&quot; height=&quot;46&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSW1YfyAo13NcfufLpAzUWLKb08YIzo3-oIqq3fGtlSOP6C6Y9NrJLV4SmBWXnko9F_GMvGc7flk3rzlysCdbvUOpdIHwnS2MFttBsD_DPU6XBwcNcekid_dPd0mLv_7kmQzMG10rYgE0/w640-h46/old-recent-replicaset.png&quot; title=&quot;kubectl get replicaset&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We notice that the old replicaset has zero pods running and the new replicaset has four pods running.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In order to rollback our changes to the previous version, we
run this command&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;kubectl rollout undo deployment &amp;lt;deployment_name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDCYzJdOp6zM4oW1zGsawJy7yqmuHHEnR83JmfaGaDka8WDeFQp8Z1toChf1_ja-mK-XbPmJEYYzvRn3wMGPTLGI8Zffn7tlNWSIFIciOff6oFGVRr075eARZFWSNY8UFv8x4XTgxwUlQ/s1501/kubectl-rollout-deployment-undo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl rollout deployment undo&quot; border=&quot;0&quot; data-original-height=&quot;80&quot; data-original-width=&quot;1501&quot; height=&quot;34&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDCYzJdOp6zM4oW1zGsawJy7yqmuHHEnR83JmfaGaDka8WDeFQp8Z1toChf1_ja-mK-XbPmJEYYzvRn3wMGPTLGI8Zffn7tlNWSIFIciOff6oFGVRr075eARZFWSNY8UFv8x4XTgxwUlQ/w640-h34/kubectl-rollout-deployment-undo.png&quot; title=&quot;kubectl rollout deployment undo&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This command destroys the new pods in the new replicaset and
creates a pods with the previous version of the app in the old replicaset.
Once, a new po dis destroyed, an old pod is created in the old replicaset.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Here we arrived at the end of the &lt;b&gt;kubernetes deployment&amp;nbsp;tutorial&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In order to check our&amp;nbsp;kubernetes&amp;nbsp;tutorial, please like our&amp;nbsp;&lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;howto program&lt;/a&gt;&lt;/b&gt;&amp;nbsp;facebook page and subscribe to our newsletter to get our latest tutorials.&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/kubernetes-deployment-explained-with-examples.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEIqnX_d_1mYoI_ETqRf_Qdbk6GOF2TwfMP-cbtZC0N8GNDx_Xx-Dm8RYJgxBkHdfH3ojc5KtrL05Ly-BaeKNlU8SxkC1N5q9xODBYrSYHt10VM3gCQh9DmtiZQ9CUokYk0BAtiATEQYU/s72-w400-h221-c/kubernetes-deployment-tutorial-for-beginners.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-3065524869064272097</guid><pubDate>Tue, 16 Jun 2020 18:17:00 +0000</pubDate><atom:updated>2020-12-09T20:31:24.093+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to install minikube in ubuntu</category><category domain="http://www.blogger.com/atom/ns#">install minikube in ubuntu</category><category domain="http://www.blogger.com/atom/ns#">installing kubernetes</category><category domain="http://www.blogger.com/atom/ns#">installing kubernetes ubuntu</category><category domain="http://www.blogger.com/atom/ns#">Kubernetes</category><title>How to install minikube on ubuntu</title><description>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF-0FkPwCDCWJKVxBVrQ-DA78pD1EGVCh8W5czqswZGR3JVCCurePD90QmRhNQRlZ4Zlnvjto8HOxZskWtU74QSrixJsrpk6tSzHvGSF_nci-QyWcia0DIZCDbQFARmzgm3SXMCDftvUk/s578/install-minikube-on-ubuntu-tutorial.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install minikube on ubuntu tutorial&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;578&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF-0FkPwCDCWJKVxBVrQ-DA78pD1EGVCh8W5czqswZGR3JVCCurePD90QmRhNQRlZ4Zlnvjto8HOxZskWtU74QSrixJsrpk6tSzHvGSF_nci-QyWcia0DIZCDbQFARmzgm3SXMCDftvUk/w400-h221/install-minikube-on-ubuntu-tutorial.png&quot; title=&quot;install minikube on ubuntu tutorial&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Install minikube on ubuntu&lt;/b&gt; is very easy. We will walk
through the necessary steps to install minikube on ubuntu from A to Z.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Install minikube on ubuntu step 1&lt;/b&gt;&amp;nbsp;:&amp;nbsp;&lt;/h2&gt;we should update the system packages to the latest release.&amp;nbsp;&lt;div&gt;To do that we run these two commands:&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;sudo apt-get update&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;sudo apt-get install apt-transport-https&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw_uWVNKfzU1Yh-DTawo7sv9eNJVDwHoISEvV7HvgX2kP5JbYGu_tioZk6gtIwN_J1uX2b1W4MD8NS91WNi_Qk9Z_jsNZshJbfrvXs5QoDHXwcTSr_S_nc77Rwsv0KoXHqbaLBHSTSci4/s1501/install-kubernetes-ubuntu-step1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install minikube on ubuntu step1&quot; border=&quot;0&quot; data-original-height=&quot;512&quot; data-original-width=&quot;1501&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiw_uWVNKfzU1Yh-DTawo7sv9eNJVDwHoISEvV7HvgX2kP5JbYGu_tioZk6gtIwN_J1uX2b1W4MD8NS91WNi_Qk9Z_jsNZshJbfrvXs5QoDHXwcTSr_S_nc77Rwsv0KoXHqbaLBHSTSci4/w640-h218/install-kubernetes-ubuntu-step1.png&quot; title=&quot;install minikube on ubuntu step1&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Install minikube on ubuntu step 2&amp;nbsp;:&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Now, we need to install virtualbox hypervisor. we will get a prompt telling us to accept the virtualbox license.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;b&gt;sudo apt install virtualbox virtualbox-ext-pack&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Install minikube on ubuntu step 3:&lt;/b&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Now, we download the minikube binary file and we copy it to
to the /usr/local/bin directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In order to do that, we run the following commands in order:&lt;/p&gt;

&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;chmod +x minikube-linux-amd64&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;sudo mv minikube-linux-amd64 /usr/local/bin/minikube&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1yOYkOeET54s_GMpbzG_8p18CjXQw6maW1a_4dPfCy7dKQm8tzcyQOG4OD0VxphZmJp6Gn25HStol95O0fCggZKcAWgJJHZCc_MRMSWnesys555_0hCZzCYUzBnPHdIrYy_jgldSch7Y/s1501/install-kubernetes-ubuntu-step3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install kubernetes ubuntu step3&quot; border=&quot;0&quot; data-original-height=&quot;485&quot; data-original-width=&quot;1501&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1yOYkOeET54s_GMpbzG_8p18CjXQw6maW1a_4dPfCy7dKQm8tzcyQOG4OD0VxphZmJp6Gn25HStol95O0fCggZKcAWgJJHZCc_MRMSWnesys555_0hCZzCYUzBnPHdIrYy_jgldSch7Y/w640-h206/install-kubernetes-ubuntu-step3.png&quot; title=&quot;install kubernetes ubuntu step3&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We add executable right to the downloaded file:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNrhyphenhyphenL0zgP4wcqrZwLuRkohA_LcxH_mLDqxvYMWbtPX623m2qfYiyiWnGjJ8DVlFdcQs8qCERNnuuguW3fHugkk6NtWZt_3NLbAhzFXqPAePK-HOS9zXpumyr8KaBoVgUnq3zHt9Jp1ak/s1501/kubernetes-install-on-ubuntu-add-executable-rights.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes install add executable rights to minikube&quot; border=&quot;0&quot; data-original-height=&quot;38&quot; data-original-width=&quot;1501&quot; height=&quot;16&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNrhyphenhyphenL0zgP4wcqrZwLuRkohA_LcxH_mLDqxvYMWbtPX623m2qfYiyiWnGjJ8DVlFdcQs8qCERNnuuguW3fHugkk6NtWZt_3NLbAhzFXqPAePK-HOS9zXpumyr8KaBoVgUnq3zHt9Jp1ak/w640-h16/kubernetes-install-on-ubuntu-add-executable-rights.png&quot; title=&quot;kubernetes install add executable rights to minikube&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Then we move the executable file to /usr/local/bin/ in order to be in the PATH.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaiSE5X9JQgsp0v7j1j89XfOI-FwEHtI2HQMeE0Q23NDDYHtCuc1yr_bDO2yViXOZIMK5UyMnr0DY7ffJTI3wB3C9Rks3D71rTOoTQ_NmNDGzOupjbXAi8cthtAvxmDgNbNkMlGqwlZ4M/s1500/install-kubernetes-ubuntu-copy-minikube-to-path.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install kubernetes ubuntu copy minikube to path&quot; border=&quot;0&quot; data-original-height=&quot;105&quot; data-original-width=&quot;1500&quot; height=&quot;44&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaiSE5X9JQgsp0v7j1j89XfOI-FwEHtI2HQMeE0Q23NDDYHtCuc1yr_bDO2yViXOZIMK5UyMnr0DY7ffJTI3wB3C9Rks3D71rTOoTQ_NmNDGzOupjbXAi8cthtAvxmDgNbNkMlGqwlZ4M/w640-h44/install-kubernetes-ubuntu-copy-minikube-to-path.png&quot; title=&quot;install kubernetes ubuntu copy minikube to path&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Next, we check if minikube was installed with success&amp;nbsp;:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxf5WFKbPFmVdtoUildK7tLpplOgaXjXEIga21z_as1i0FyWJrHz-ObwDoFGjDiPtadoGVDyOD0v23nLk3QMBnB0nN-6-q_lMRavAXuOLztmkB0wgJovyGQsZNHBreoqmP5-8rGXEbK4Q/s1501/install-kubernetes-ubuntu-minikube-version.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install kubernetes ubuntu minikube version&quot; border=&quot;0&quot; data-original-height=&quot;98&quot; data-original-width=&quot;1501&quot; height=&quot;42&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxf5WFKbPFmVdtoUildK7tLpplOgaXjXEIga21z_as1i0FyWJrHz-ObwDoFGjDiPtadoGVDyOD0v23nLk3QMBnB0nN-6-q_lMRavAXuOLztmkB0wgJovyGQsZNHBreoqmP5-8rGXEbK4Q/w640-h42/install-kubernetes-ubuntu-minikube-version.png&quot; title=&quot;install kubernetes ubuntu minikube version&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Install minikube on ubuntu : Step 4&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We need to install the Kubernetes command line tool (kubectl)
in order to manage our cluster.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Here, the cluster is composed by a single node.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In order to do that, we run this command&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;b&gt;

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha-ibH_gyJGFlUA0rYvhfICm7q8dhESqssRQiDFzyq5o5Tf7TFi6IErpRFeptZnArf9VBft2d5CwRYyV3flNFeCmDJd0AyxF5Yir2Xgq7Hyms_UstHzVgcOTP9H5r09ToayQ-W1c_G3gc/s1501/install-minikube-ubuntu-kubectl-download.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;install-minkube-ubuntu-kubectl-download&quot; border=&quot;0&quot; data-original-height=&quot;232&quot; data-original-width=&quot;1501&quot; height=&quot;98&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEha-ibH_gyJGFlUA0rYvhfICm7q8dhESqssRQiDFzyq5o5Tf7TFi6IErpRFeptZnArf9VBft2d5CwRYyV3flNFeCmDJd0AyxF5Yir2Xgq7Hyms_UstHzVgcOTP9H5r09ToayQ-W1c_G3gc/w640-h98/install-minikube-ubuntu-kubectl-download.png&quot; title=&quot;install-minkube-ubuntu-kubectl-download&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Next, we add the exécution permission to kubectl file&amp;nbsp; using this command: &lt;b&gt;chmod +x ./kubectl&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Then, we move the kubectl file to the directory
/usr/local/bin to be able to call it from any directory in the system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;b&gt;

sudo mv ./kubectl /usr/local/bin/kubectl&lt;/b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSAt-sV1Sj037Se4azqyZLlYUG0aiOkgeVdSO4oBm_Lgv680eh0l7EsyUK3FghgIcOHlwbxKOjRfiwE0PQM9_rIq3kJ9o8nDK_YxX5fBaSglAAfz55LvJAunW7uNGtKmmSN3be3BshN-E/s1501/install-minikube-ubuntu-add-executable-rights-kubectl.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install minikube ubuntu add execution rights kubectl&quot; border=&quot;0&quot; data-original-height=&quot;109&quot; data-original-width=&quot;1501&quot; height=&quot;46&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSAt-sV1Sj037Se4azqyZLlYUG0aiOkgeVdSO4oBm_Lgv680eh0l7EsyUK3FghgIcOHlwbxKOjRfiwE0PQM9_rIq3kJ9o8nDK_YxX5fBaSglAAfz55LvJAunW7uNGtKmmSN3be3BshN-E/w640-h46/install-minikube-ubuntu-add-executable-rights-kubectl.png&quot; title=&quot;install minikube ubuntu add execution rights kubectl&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We check whether the installation of kubectl succeeded or
not using the following command&amp;nbsp;:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;kubectl version&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbyVvGm51lH-xYheRdK_9PK6oqzmUvtOUppS-Zx7JexFAZQITA4Fa28mkGOc4ZiWheADfMJBdnXpDiI-P_itU7AutGLr3Rc6CLxjR1haNhTynnpsOH9NiF1lPn6e2nvoVD_12nk5qSPV0/s1501/install-minikube-ubuntu-kubectl-version.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;install minikube ubuntu kubectl version&quot; border=&quot;0&quot; data-original-height=&quot;258&quot; data-original-width=&quot;1501&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbyVvGm51lH-xYheRdK_9PK6oqzmUvtOUppS-Zx7JexFAZQITA4Fa28mkGOc4ZiWheADfMJBdnXpDiI-P_itU7AutGLr3Rc6CLxjR1haNhTynnpsOH9NiF1lPn6e2nvoVD_12nk5qSPV0/w640-h110/install-minikube-ubuntu-kubectl-version.png&quot; title=&quot;install minikube ubuntu kubectl version&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Install minikube on ubuntu&amp;nbsp;: step 5&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Now we will start minikube using this command&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;b&gt;minikube start&lt;/b&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This will download the minikube iso file and launch the
minikube virtual machine.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 23.25pt; margin-bottom: 19.5pt;&quot;&gt;To stop a running kubernetes
cluster, we run this command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;b&gt;minikube stop&lt;/b&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 23.25pt; margin-bottom: 19.5pt;&quot;&gt;To delete a running kubernetes
cluster, we run this command:&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 23.25pt; margin-bottom: 19.5pt;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;b&gt;minikube delete&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Install minikube on ubuntu &lt;/b&gt;: step 6&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;minikube has&amp;nbsp; a web dashboard
that allows to manage the minikube cluster from a web interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;To get the url of this dashboard, we run this command&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;b&gt;minikube dashboard --url&lt;/b&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;This &lt;b&gt;install&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;kubernetes on ubuntu tutorial for beginners&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;&amp;nbsp;arrives at its end.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;If you want to deep dive into kubernetes, you can check our&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-cluster-architecture.html&quot; target=&quot;_blank&quot;&gt;kubernate cluster architecture tutorial&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-pod-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;kubernetes pod tutorial&lt;/a&gt;&amp;nbsp;or&amp;nbsp;our&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-replicaset-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;kubernetes replicaset tutorial&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;To check our other tutorials, you can like our&amp;nbsp;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&amp;nbsp;facebook page.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</description><link>https://javasneo.blogspot.com/2020/06/how-to-install-minikube-on-ubuntu.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF-0FkPwCDCWJKVxBVrQ-DA78pD1EGVCh8W5czqswZGR3JVCCurePD90QmRhNQRlZ4Zlnvjto8HOxZskWtU74QSrixJsrpk6tSzHvGSF_nci-QyWcia0DIZCDbQFARmzgm3SXMCDftvUk/s72-w400-h221-c/install-minikube-on-ubuntu-tutorial.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-6505172162458458157</guid><pubDate>Mon, 15 Jun 2020 21:05:00 +0000</pubDate><atom:updated>2020-12-09T20:33:12.353+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Kubernetes</category><category domain="http://www.blogger.com/atom/ns#">kubernetes cluster</category><title>Kubernetes cluster architecture</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrTAa-MB22fbis82FnzXdL0_UpHw7XpMOaDfKjsZwNJ6ji6lCVG6lDOTpPiNi59ik0m8LQhPMpKQx_u1wgeNz_QTRRDc_41fEJ2yprJuErop7DuiXHpJC6h_JvUG_LRDNNKjoP3q7I9-4/s578/kubernetes-cluster-architecture.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes cluster architecture&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;578&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrTAa-MB22fbis82FnzXdL0_UpHw7XpMOaDfKjsZwNJ6ji6lCVG6lDOTpPiNi59ik0m8LQhPMpKQx_u1wgeNz_QTRRDc_41fEJ2yprJuErop7DuiXHpJC6h_JvUG_LRDNNKjoP3q7I9-4/w400-h221/kubernetes-cluster-architecture.png&quot; title=&quot;kubernetes cluster architecture&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Kubernetes cluster architecture&amp;nbsp;: introduction&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Kubernetes cluster architecture&lt;/b&gt; is a complex subject. Here we will try to clarify the concepts and make it easy to understand for beginners.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;A node is a machine (virtual machine or a real machine)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;If you have an application running in a single node and the
node goes down, the application goes offline and this incurs a loss of money.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;This is why we deploy our app in a cluster which is a set of
nodes&amp;nbsp;: if a node fails, the other nodes will execute the app and there
will not be a service interrupt.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In kubernetes, there are master nodes and a set of worker
nodes. A master node manages the worker nodes (it is responsible for the
distribution of the traffic between the worker nodes, replaces a worker node
which goes down, orchestrates the containers running inside the nodes, etc).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;A masternode is a node that has kubernetes installed in it
and it is configured as a masternode.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwz2ZczyYS5e9i_3UupQsA2Z9lzPlSUUr45sW6s4JwKw9iHqrV9IxAZvN8Tf-bsHrKZW4clXV1dGA57xZRba39LP1DLnrs4T25IQKk_UKKHt_GgJnHHp7fK85msd8FTlJdBMJwwniNnro/s1280/kubernetes-cluster-diagram.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes cluster diagram&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;351&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwz2ZczyYS5e9i_3UupQsA2Z9lzPlSUUr45sW6s4JwKw9iHqrV9IxAZvN8Tf-bsHrKZW4clXV1dGA57xZRba39LP1DLnrs4T25IQKk_UKKHt_GgJnHHp7fK85msd8FTlJdBMJwwniNnro/w625-h351/kubernetes-cluster-diagram.png&quot; title=&quot;kubernetes cluster diagram&quot; width=&quot;625&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Roles of kubernetes components&amp;nbsp;:&lt;/b&gt;&lt;/h2&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu0pN7V9esoC4nB2vZPAOQUecEYnu9W_LJLla4cSp6reuuJyNkAqtqCIWYPRnl3JKD0c_URGM92WMyvA8F1TG1dd8VXZEaTsB4UQXeeXYTs7CooRpYipALYoKUhE54Ip7fGqPV8k728RI/s1280/kubernetes-components-diagram.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes components diagram&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu0pN7V9esoC4nB2vZPAOQUecEYnu9W_LJLla4cSp6reuuJyNkAqtqCIWYPRnl3JKD0c_URGM92WMyvA8F1TG1dd8VXZEaTsB4UQXeeXYTs7CooRpYipALYoKUhE54Ip7fGqPV8k728RI/w640-h360/kubernetes-components-diagram.png&quot; title=&quot;kubernetes components diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The &lt;b&gt;Kubectl &lt;/b&gt;command line interface communicates with the api
server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;etcd&amp;nbsp;&lt;/b&gt;: is a key value store used to store the data
needed to manage the cluster.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Scheduler&lt;/b&gt;: is responsible for distributing the containers
across multiple nodes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;The controller&lt;/b&gt;: is responsible for adding containers and
removing them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Container runtime&lt;/b&gt; is the runtime necessary to run containers
(docker)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Kubelet&lt;/b&gt;&amp;nbsp;: is the agent running on each node in the
cluster. It is responsible for monitoring the containers and checking if they
are running as expected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Masternode vs worker node&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf6dZDPZP6l0xmVcu7WXCIWe5RW_8nV6xI-L7TTHW3EY6XJy5SO_HIQlYWIbvq34ckqwd7i2f2XQ7QjMNilG0udR-T7y2tDB3ob6Xju_sWk20umTQun_zezwbCKgpXYPdv-6mxw6NMEm4/s1280/kubernetes-master-node-worker-node.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes master node worker node&quot; border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf6dZDPZP6l0xmVcu7WXCIWe5RW_8nV6xI-L7TTHW3EY6XJy5SO_HIQlYWIbvq34ckqwd7i2f2XQ7QjMNilG0udR-T7y2tDB3ob6Xju_sWk20umTQun_zezwbCKgpXYPdv-6mxw6NMEm4/w640-h360/kubernetes-master-node-worker-node.png&quot; title=&quot;kubernetes master node worker node&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This diagram shows the components explained above and their distribution on nodes.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;This differs depending on whether the node is a master node or a worker node.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;This&amp;nbsp;&lt;b&gt;kubernetes architecture tutorial for beginners&lt;/b&gt;&amp;nbsp;arrives at its end.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;If you want to deep dive into kubernetes, you can check our &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-pod-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;kubernetes pod tutorial&lt;/a&gt; or our &lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-replicaset-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;kubernetes replicaset tutorial&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;To check our other tutorials, you can like our&amp;nbsp;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&amp;nbsp;facebook page.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;</description><link>https://javasneo.blogspot.com/2020/06/kubernetes-cluster-architecture.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrTAa-MB22fbis82FnzXdL0_UpHw7XpMOaDfKjsZwNJ6ji6lCVG6lDOTpPiNi59ik0m8LQhPMpKQx_u1wgeNz_QTRRDc_41fEJ2yprJuErop7DuiXHpJC6h_JvUG_LRDNNKjoP3q7I9-4/s72-w400-h221-c/kubernetes-cluster-architecture.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-6630101185193704152</guid><pubDate>Sat, 13 Jun 2020 22:02:00 +0000</pubDate><atom:updated>2020-12-09T20:35:10.705+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Kubernetes</category><category domain="http://www.blogger.com/atom/ns#">kubernetes replica set</category><category domain="http://www.blogger.com/atom/ns#">kubernetes replicaset</category><category domain="http://www.blogger.com/atom/ns#">replicaset kubernetes</category><title>Kubernetes Replicaset tutorial for beginners</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-BvKwXTLBkNgb2SxWA13EH9k4F02bkgErZKDqjs7xjggktExEMAlv3mjWgC9aK2sw-gBcHm0mgXCY33PVmRZ0ROGbedCT4K0CkX10OOFHLGZjkHhOCggZ4ASHE_pdYUblNZKR5mcsbwE/s549/kubernetes-replicaset-tutorial-for-beginners.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes-replicaset-tutorial-for-beginners&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;549&quot; height=&quot;187&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-BvKwXTLBkNgb2SxWA13EH9k4F02bkgErZKDqjs7xjggktExEMAlv3mjWgC9aK2sw-gBcHm0mgXCY33PVmRZ0ROGbedCT4K0CkX10OOFHLGZjkHhOCggZ4ASHE_pdYUblNZKR5mcsbwE/w320-h187/kubernetes-replicaset-tutorial-for-beginners.png&quot; title=&quot;kubernetes-replicaset-tutorial-for-beginners&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Kubernetes Replicaset : introduction&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Kubernetes replicaset monitors a set of pods&amp;nbsp;: if a pod
crashes, the replicaset replaces it and guarantees that we have the required
number of replicas (pods).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;This is the pod definition file that we created in the
&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/kubernetes-pod-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;kubernetes pod tutorial&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    name: nginx
    tier: frontend
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
     - containerPort: 80
&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;In order to create the replicaset definition file, we will
reuse the pod definition file&amp;nbsp;: we will use all the sections of the pod
definition file except the apiVersion and the kind sections.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We paste the pod definition file in the template section of
the replicaset definition file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Also, we add two sections&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Replicas&amp;nbsp;: the number of pods that the replicaset will
manage&lt;/li&gt;&lt;li&gt;Selector&amp;nbsp;: designs the pods that will be managed by the
replicaset&amp;nbsp;: those pods will have the label tier with the value frontend. If
we check the pod definition part, we see that the pod has a label tier with the
value frontend.&lt;/li&gt;&lt;/ul&gt;&lt;pre class=&quot;code-box short-b&quot; style=&quot;text-align: left;&quot;&gt;apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: frontend
  labels:
    app: guestbook
    tier: frontend
spec:
  template:
    metadata:
      name: nginx
      labels:
        name: nginx
        tier: frontend
    spec:
      containers:
        - name: nginx
          image: nginx
          ports:
           - containerPort: 80
  replicas: 3
  selector:
    matchLabels:
     tier: frontend
&lt;/pre&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Kubernetes replicaset creation&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;We create a replicaset based on the definition file using
this command&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Kubectl create -f replicaset-definition-file.yaml&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHFNV9E_ZOYqAp1ObWLm3JMZWCnGu0R4y-iNAffSyNljuZgDn6ZmtJmSzppadHm7H6B9tVP3ho2dYNO50AXjHIdCyNauHHWthr9_kequxg-8c7K1welVlhGFbQR32Vgd5y3VxYW4Enxck/s1501/kubectl-create-replicaset.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-create-replicaset&quot; border=&quot;0&quot; data-original-height=&quot;140&quot; data-original-width=&quot;1501&quot; height=&quot;60&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHFNV9E_ZOYqAp1ObWLm3JMZWCnGu0R4y-iNAffSyNljuZgDn6ZmtJmSzppadHm7H6B9tVP3ho2dYNO50AXjHIdCyNauHHWthr9_kequxg-8c7K1welVlhGFbQR32Vgd5y3VxYW4Enxck/w640-h60/kubectl-create-replicaset.png&quot; title=&quot;kubectl-create-replicaset&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We check our replicaset using this command that lists the
available replicasets&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,sans-serif; font-size: 11.0pt; line-height: 107%; mso-ansi-language: FR; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;kubectl get replicasets&lt;/span&gt;&lt;/b&gt;&lt;div&gt;&lt;b&gt;&lt;font face=&quot;Calibri, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 14.6667px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;font face=&quot;Calibri, sans-serif&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-weight: bold; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgVq_vNMLLBOUXuwbcjQaI3YEKp4903io9QXV5_W13ECGQ3Hx5zX5FqWt2MDaQ6kQR5vhmlmit7VuMvfj-XDVICr9L5z0bnYDEK34hhVhImIapYVYnVNJnTNtlp9P30F5rKTCnWDRyf5c/s1500/kubectl-get-replicasets.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-get-replicaset&quot; border=&quot;0&quot; data-original-height=&quot;190&quot; data-original-width=&quot;1500&quot; height=&quot;82&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgVq_vNMLLBOUXuwbcjQaI3YEKp4903io9QXV5_W13ECGQ3Hx5zX5FqWt2MDaQ6kQR5vhmlmit7VuMvfj-XDVICr9L5z0bnYDEK34hhVhImIapYVYnVNJnTNtlp9P30F5rKTCnWDRyf5c/w640-h82/kubectl-get-replicasets.png&quot; title=&quot;kubectl-get-replicaset&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-size: 14.6667px;&quot;&gt;&lt;div&gt;&lt;font face=&quot;Calibri, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 14.6667px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;Here we see that we have a unique replicaset which name is frontend.&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face=&quot;Calibri, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 14.6667px;&quot;&gt;The replicaset manages three pods. Those pods are in the ready state.&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Scale Kubernetes pods&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Now, we have 3 pods declared in the replicaset definition
file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We aim to scale up to have 6 pods. We can do it using three
methods&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;1)&lt;span style=&quot;font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;Method 1&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Change the replicas in the replicaset
definition file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Run kubectl replace -f
replicaset-definition-file.yml&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 72.0pt; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;2)&lt;span style=&quot;font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Method 2&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Kubectl scale –replicas=6 -f
replicaset-definition-file.yml&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 72.0pt; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;3)&lt;span style=&quot;font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Method 3&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Kubectl scale –replicas=6 replicaset frontend ( frontend&amp;nbsp;: the name of replicaset in the
replicaset definition file)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: 72.0pt; mso-add-space: auto; mso-list: l0 level2 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;



















&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We will use the first method to scale our replicaset&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimSmiLbfsQoU2GYxcovAwB6395y42BZYJ1ADKewgGumhXTsbqNsA_7cWfZU87cmi8yAITB8Xd_056otJqaqJUZQX5wNu5HNYpaVAkXxE1-Q5EbaTbhJHUjAbnQ15jJ3bXiY8qLFtNEQr4/s1501/kubectl-replace-replicaset.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-scale-replicaset&quot; border=&quot;0&quot; data-original-height=&quot;134&quot; data-original-width=&quot;1501&quot; height=&quot;58&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimSmiLbfsQoU2GYxcovAwB6395y42BZYJ1ADKewgGumhXTsbqNsA_7cWfZU87cmi8yAITB8Xd_056otJqaqJUZQX5wNu5HNYpaVAkXxE1-Q5EbaTbhJHUjAbnQ15jJ3bXiY8qLFtNEQr4/w640-h58/kubectl-replace-replicaset.png&quot; title=&quot;kubectl-scale-replicaset&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We check the number of pods created using the command &lt;b&gt;kubectl
get pods&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8p4mcJn_12UYfww-k4TXOe4mjQ4P3XfJvIPCKzD9H6a9cb2ZSu3PUjYWidwkf6SGEN-jmBdE2fIYC0TxAdM1zdVicvn1-11RDKeeP8n0x7v3uDKVQxUlQjxuxu1rntUEN-rDjezwA4uE/s1501/kubectl-get-pods.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-get-pods&quot; border=&quot;0&quot; data-original-height=&quot;305&quot; data-original-width=&quot;1501&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8p4mcJn_12UYfww-k4TXOe4mjQ4P3XfJvIPCKzD9H6a9cb2ZSu3PUjYWidwkf6SGEN-jmBdE2fIYC0TxAdM1zdVicvn1-11RDKeeP8n0x7v3uDKVQxUlQjxuxu1rntUEN-rDjezwA4uE/w640-h130/kubectl-get-pods.png&quot; title=&quot;kubectl-get-pods&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We notice that we have six kubernetes pods running.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;If we delete a pod using the command&amp;nbsp;: kubectl delete
pod &amp;lt;pod_name&amp;gt;, we will notice that the replicaset will replace the
deleted pod&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx6ucvqs6YjMdFT1nCR-qrXyMLV169zg_KI0hF2kQNl2hUQWVXAAmdwsRkSp0w_3fCOfWvvtBkk9JEQnnV3o_-D2uUipccYKUvBJ_dJlQXeyIKBle2JPjbPoDef86choUXWZaReMxEiAQ/s1500/kubectl-replicaset-manage-pods.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-delete-pod&quot; border=&quot;0&quot; data-original-height=&quot;601&quot; data-original-width=&quot;1500&quot; height=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx6ucvqs6YjMdFT1nCR-qrXyMLV169zg_KI0hF2kQNl2hUQWVXAAmdwsRkSp0w_3fCOfWvvtBkk9JEQnnV3o_-D2uUipccYKUvBJ_dJlQXeyIKBle2JPjbPoDef86choUXWZaReMxEiAQ/w640-h256/kubectl-replicaset-manage-pods.png&quot; title=&quot;kubectl-delete-pod&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Delete kubernetes replicaset&lt;/b&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;We use the following command in order to delete a replicaset&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;



&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;kubectl delete replicaset &amp;lt;replicaset-name&amp;gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFRygiL0v_jdqJDDdajyQsgjSFz6jDFYh6MaEmGRZNwaehQuG7d6VNhjMtvQe6hw4k73IW-ZOJOTdwqzjTgxDhK73BGJmwCj0FiWg4Za08tCaYYXTqRcuTTcUqH1KzS2Bn4_YGn30u6pM/s1501/kubectl-delete-replicaset.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-delete-replicaset&quot; border=&quot;0&quot; data-original-height=&quot;209&quot; data-original-width=&quot;1501&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFRygiL0v_jdqJDDdajyQsgjSFz6jDFYh6MaEmGRZNwaehQuG7d6VNhjMtvQe6hw4k73IW-ZOJOTdwqzjTgxDhK73BGJmwCj0FiWg4Za08tCaYYXTqRcuTTcUqH1KzS2Bn4_YGn30u6pM/w640-h90/kubectl-delete-replicaset.png&quot; title=&quot;kubectl-delete-replicaset&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;When we delete a replicaset, the pods that it manages will be deleted as well.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;If we check the presence of these pods, we will find nothing:&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2-soQSg_t6DJFmhzt2jqxa58BFbjdp9CIOBm7GGJhH94XVQqcwO_y9dzfPnbGxG2Y0Fdi5ATZIg0GAtjcTM_fbaO9HQFCqvhQQzGHMh-K0FzeTcmi9V_z2gsczlUaJJoYJDx7bWCYpZw/s1501/kubernetes-pods-deleted.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-get-pods&quot; border=&quot;0&quot; data-original-height=&quot;118&quot; data-original-width=&quot;1501&quot; height=&quot;50&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2-soQSg_t6DJFmhzt2jqxa58BFbjdp9CIOBm7GGJhH94XVQqcwO_y9dzfPnbGxG2Y0Fdi5ATZIg0GAtjcTM_fbaO9HQFCqvhQQzGHMh-K0FzeTcmi9V_z2gsczlUaJJoYJDx7bWCYpZw/w640-h50/kubernetes-pods-deleted.png&quot; title=&quot;kubectl-get-pods&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;This&amp;nbsp;&lt;b&gt;kubernetes replicaset tutorial for beginners&lt;/b&gt;&amp;nbsp;arrives at its end.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;To check our other tutorials, you can like our&amp;nbsp;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt;&amp;nbsp;facebook page.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/div&gt;</description><link>https://javasneo.blogspot.com/2020/06/kubernetes-replicaset-tutorial-for-beginners.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-BvKwXTLBkNgb2SxWA13EH9k4F02bkgErZKDqjs7xjggktExEMAlv3mjWgC9aK2sw-gBcHm0mgXCY33PVmRZ0ROGbedCT4K0CkX10OOFHLGZjkHhOCggZ4ASHE_pdYUblNZKR5mcsbwE/s72-w320-h187-c/kubernetes-replicaset-tutorial-for-beginners.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-4564372116712314163</guid><pubDate>Sat, 13 Jun 2020 15:30:00 +0000</pubDate><atom:updated>2020-12-05T19:44:19.152+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Kubernetes</category><category domain="http://www.blogger.com/atom/ns#">kubernetes pod</category><category domain="http://www.blogger.com/atom/ns#">pod kubernetes</category><title>Kubernetes pod tutorial for beginners</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;Kubernetes Pod creation&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1erA3SA8cBmw9blnXeYXW5KQYDLauyuSnf1M1mwncySjPhS_Af47WOXtQd0nY1wWtS3JTRgLSXvL_KVmRkoVAinIt8HE7bCEu_lvFvg6P6rGn_mYG1n7cBNiduSKiyH2-jz6pt4mTat0/s524/kubernetes.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubernetes-pods-tutorial-for-beginners&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;524&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1erA3SA8cBmw9blnXeYXW5KQYDLauyuSnf1M1mwncySjPhS_Af47WOXtQd0nY1wWtS3JTRgLSXvL_KVmRkoVAinIt8HE7bCEu_lvFvg6P6rGn_mYG1n7cBNiduSKiyH2-jz6pt4mTat0/w320-h195/kubernetes.png&quot; title=&quot;kubernetes-pods-tutorial-for-beginners&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h3&gt;&lt;h3&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;There are two ways of creating a &lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Kubernetes pod&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;.&lt;/span&gt;&lt;/h3&gt;&lt;h3&gt;&lt;b&gt;Kubernetes pod creation way 1&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;kubectl run nginx --image=nginx&amp;nbsp;: creates a deployment nginx which creates a pod from the image nginx&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3bO4BrXYnzVF0PS7xkwpXmuriZvAS_TJLK-NPDYs48wsRs0c1QEjOho0OGGOq4kJds-DXbWd68tScdm801oAEcWI2t6JwMqfLtlzi8lYewq3j_sTEqrSI4B2ycTTfsMsx4Ai2vA7jjTQ/s1480/kubernetes-create-pod-way-1.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;create-kubernetes-pod-way-1&quot; border=&quot;0&quot; data-original-height=&quot;196&quot; data-original-width=&quot;1480&quot; height=&quot;84&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3bO4BrXYnzVF0PS7xkwpXmuriZvAS_TJLK-NPDYs48wsRs0c1QEjOho0OGGOq4kJds-DXbWd68tScdm801oAEcWI2t6JwMqfLtlzi8lYewq3j_sTEqrSI4B2ycTTfsMsx4Ai2vA7jjTQ/w640-h84/kubernetes-create-pod-way-1.PNG&quot; title=&quot;create-kubernetes-pod-way-1&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;font face=&quot;Segoe UI, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 15.3333px;&quot;&gt;When we run the command&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 15.3333px;&quot;&gt;kubectl get pods, we see our created pod. Its name is nginx-6b489d4b7-9qghk.&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiSdFYrgW3etKShh3NSAsnLqY7RGjIBLwQeyjxV-ris4FREOMcGMwFXfnsCoa81ndGhnh86rMiVr0JvqXZBbQu80eZomMkhoalIoe2YFF3Bv6-30V-pjRJXNgOm_AupIEnFBX5XB-Um_c/s825/kubernetes-list-pods.PNG&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-get-pods&quot; border=&quot;0&quot; data-original-height=&quot;114&quot; data-original-width=&quot;825&quot; height=&quot;88&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiSdFYrgW3etKShh3NSAsnLqY7RGjIBLwQeyjxV-ris4FREOMcGMwFXfnsCoa81ndGhnh86rMiVr0JvqXZBbQu80eZomMkhoalIoe2YFF3Bv6-30V-pjRJXNgOm_AupIEnFBX5XB-Um_c/w640-h88/kubernetes-list-pods.PNG&quot; title=&quot;kubectl-get-pods&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To display the informations of the created deployment, we run this command:&lt;b&gt;kubectl get deployments&lt;/b&gt;. The result of executing this command is the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLg6taK3W36qrLef05eW5vwVpgRwqk_hAvJh2Kpu6SxvaN4Jl0OmJtR8xZ8Fj7SpImofPkGHSdQsSycAk-BxKGNang_ohacIzDoh5qs4ZPy43_MUnW0HdN4Wcl0fxDjxMMuDP7CQ7Y4Dw/s653/kubernetes-get-deployment.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-get-deployments&quot; border=&quot;0&quot; data-original-height=&quot;116&quot; data-original-width=&quot;653&quot; height=&quot;114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLg6taK3W36qrLef05eW5vwVpgRwqk_hAvJh2Kpu6SxvaN4Jl0OmJtR8xZ8Fj7SpImofPkGHSdQsSycAk-BxKGNang_ohacIzDoh5qs4ZPy43_MUnW0HdN4Wcl0fxDjxMMuDP7CQ7Y4Dw/w640-h114/kubernetes-get-deployment.PNG&quot; title=&quot;kubectl-get-deployments&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 16.4067px;&quot;&gt;Kubernetes&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;pod creation way2&amp;nbsp;: using pod
definition file&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;Kubernetes pod definition file&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;The kubernetes pod definition file is composed from 3
parts&amp;nbsp;:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; text-indent: -18pt;&quot;&gt;apiVersion&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; text-indent: -18pt;&quot;&gt;kind&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; text-indent: -18pt;&quot;&gt;metadata&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; text-indent: -18pt;&quot;&gt;spec&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;Example of kubernetes pod definition file&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    name: nginx
    app: nginx-app
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
     - containerPort: 80&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;In the case of a pod, the kind section is always equal to Pod.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;The labels part is used to distinguish the pods created by this definition file (it is used by replication set to monitor a subset of pods having a label)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;The spec part contains the containers which will be created in the pod. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;We notice that the containers section contains an array of objects&amp;nbsp;: this means that we can run multiple containers in the same
pod.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;Her ewe specified a unique container created using the nginx image and running on the port 80.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;In order to create the pod, we run this command&amp;nbsp;:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;&lt;b&gt;kubectl create pod -f pod-definition-file.yml&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;This command creates only a pod resource based on the pod definition file described above.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;It doesn&#39;t create any resource other than the pod.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;Displaying informations about kubernetes pods:&lt;/span&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;&lt;b&gt;kubectl describe pod &amp;lt;pod_name&amp;gt;&lt;/b&gt;&amp;nbsp;: checks informations about a pod (image name, node name, how many containers are
running on the pod, get the state of the container in the pod, &amp;nbsp;etc)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;font face=&quot;Segoe UI, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 15.3333px;&quot;&gt;&lt;b&gt;Container image name: &lt;/b&gt;we find it in the containers section of the out put of the describe command&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;font face=&quot;Segoe UI, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 15.3333px;&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;font face=&quot;Segoe UI, sans-serif&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcIoIycv35NV3VAm8DDumkMOZWlMk3z3obHVsHYjO929TycoZZ7a93tbtVfBYpjhIZit0pAQbGl9W7-zkU_gML1q-nNPTvgVDPvlAHLwpduRd8uizDiD0OhcTr-VS7YfNrkM727F6xjCU/s1476/kubernetes-pod-container-image.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-describe-pod-container-image&quot; border=&quot;0&quot; data-original-height=&quot;138&quot; data-original-width=&quot;1476&quot; height=&quot;60&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcIoIycv35NV3VAm8DDumkMOZWlMk3z3obHVsHYjO929TycoZZ7a93tbtVfBYpjhIZit0pAQbGl9W7-zkU_gML1q-nNPTvgVDPvlAHLwpduRd8uizDiD0OhcTr-VS7YfNrkM727F6xjCU/w640-h60/kubernetes-pod-container-image.PNG&quot; title=&quot;kubectl-describe-pod-container-image&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;Here we figure out that there is one container running in the pod and the corresponding image is the nginx image.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;kubectl get pods -o wide&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt;&quot;&gt;&amp;nbsp;: displays on which node each &lt;i&gt;kubernetes pod&lt;/i&gt; &lt;/span&gt;is running&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ0fRF0yauLwQOabpC7EFVzQi2dmtn_E6S1DSbidK94Avw96qqYqiEK6_I4g-xUayDxr1lGwQ2Y0I8iWRXNGHLnLtw4cQaMvZhg5rQu_N3y77Cnq5r9icV6Wj7X4vGY5F6tpuVOewKR14/s1472/kubernetes-get-pods-nodes.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kubectl-get-pods-o-wide&quot; border=&quot;0&quot; data-original-height=&quot;134&quot; data-original-width=&quot;1472&quot; height=&quot;58&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ0fRF0yauLwQOabpC7EFVzQi2dmtn_E6S1DSbidK94Avw96qqYqiEK6_I4g-xUayDxr1lGwQ2Y0I8iWRXNGHLnLtw4cQaMvZhg5rQu_N3y77Cnq5r9icV6Wj7X4vGY5F6tpuVOewKR14/w640-h58/kubernetes-get-pods-nodes.PNG&quot; title=&quot;kubectl-get-pods-o-wide&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Here the pod is running on the node vps-a45eb589.&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;This &lt;b&gt;kubernetes pod tutorial for beginners&lt;/b&gt; arrives at its end.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;segoe ui&amp;quot;, sans-serif; font-size: 11.5pt; line-height: 107%;&quot;&gt;To check our others tutorials, you can like our &lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;how to program&lt;/a&gt; facebook page.&lt;/span&gt;&lt;/p&gt;




</description><link>https://javasneo.blogspot.com/2020/06/kubernetes-pod-tutorial-for-beginners.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1erA3SA8cBmw9blnXeYXW5KQYDLauyuSnf1M1mwncySjPhS_Af47WOXtQd0nY1wWtS3JTRgLSXvL_KVmRkoVAinIt8HE7bCEu_lvFvg6P6rGn_mYG1n7cBNiduSKiyH2-jz6pt4mTat0/s72-w320-h195-c/kubernetes.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-4936563170440163947</guid><pubDate>Fri, 12 Jun 2020 16:57:00 +0000</pubDate><atom:updated>2020-12-09T20:36:38.985+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><category domain="http://www.blogger.com/atom/ns#">explain public static void main</category><category domain="http://www.blogger.com/atom/ns#">java public static void main</category><category domain="http://www.blogger.com/atom/ns#">public static void main</category><title> public static void main string arguments | what is public static void main string arguments in java</title><description>&lt;div class=&quot;separator&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinHNFhrF8jwedmnyiCU9UyPi9RYp9CXoDWMHaAqTatn_kGXQFrNuDBRfxjp07KOgi30w01VNznlgh08QhIwVzIn1JoOiSB2ejiZzygOvSNFsUCOkuI0q-seFBQW36dt7gH1hUYY6XBGh4/s522/public-static-void-main-args-java.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;public static void main string arguments&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinHNFhrF8jwedmnyiCU9UyPi9RYp9CXoDWMHaAqTatn_kGXQFrNuDBRfxjp07KOgi30w01VNznlgh08QhIwVzIn1JoOiSB2ejiZzygOvSNFsUCOkuI0q-seFBQW36dt7gH1hUYY6XBGh4/w400-h245/public-static-void-main-args-java.jpg&quot; title=&quot;public static void main string arguments&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;
  &lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;public static void main string arguments introduction&lt;/span&gt;&lt;/b&gt;
&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;public static void main string arguments&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;
    method is the entry point to any java program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;Here, we speak about desktop applications. In the web context, there is a
    container that will manage the startup and the shutdown of a java
    application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;We will present a simple example that shows how to use the
    &lt;b&gt;public static void main string args in java&lt;/b&gt; :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;public class TestMain {&lt;/font&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
  &lt;font color=&quot;#41b375&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public static void main(String[] args) {&lt;/span&gt;
&lt;/font&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
  &lt;font color=&quot;#41b375&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.out.println(&quot;Hello JAVA from how-to-program-in-java.com&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/font&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;
  &lt;font color=&quot;#41b375&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;
&lt;/font&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;The &lt;i&gt;public static void main string args&lt;/i&gt; method must go inside a
    class. There are no standalone methods in java. Everything goes into&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java classes&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;The class that contains the &lt;i&gt;public static void main&lt;/i&gt; method is the
    principal class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;Here, our main class is called TestMain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;The main method is the method that gets executed when our program
    executes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;So, when we create classes and we don’t use them inside the
    &lt;b&gt;main&lt;/b&gt; method, those classes aren’t actually used by our program: They
    are useless.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;In fact, we use classes inside the main method by creating&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-objects-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java objects&lt;/a&gt;&amp;nbsp;based on those
    classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;The program above prints in the console the message: Hello JAVA from
    how-to-program-in-java.com&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;public static void main string arguments explained&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;Now, we will explain the keywords present in the signature of the main
    method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;
    : defines the visibility of the public static void main(String args) method.
    It means that this method can be accessed by any other class with no
    problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;In fact, this method will not be accessed by others classes. It will be
    executed by the JVM when our program runs. But, keeping the public keyword
    is mandatory to let the JVM execute this method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;:&lt;span&gt;&amp;nbsp; &lt;/span&gt;This keyword means that the &lt;b&gt;main method&lt;/b&gt; belongs
    to the class itself and doesn’t belong to instances of this class. This
    keyword allows us to call a method without creating an instance of the class
    that contains this method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;In our case, the JVM will call this method without creating an instance of
    the class TestMain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;This will save a little bit of memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;:&lt;span&gt;&amp;nbsp; &lt;/span&gt;this keyword means that the public static void main
    method doesn’t return anything.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;So, we don’t expect any returned value from the main method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;String [] args&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;: this is a java array of strings. It can be used to pass arguments to the
    main method when executing it. The type of elements in the array is String
    because we can convert any type to a string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;Also, we can change the name of the array (args) with no problem. It is
    dealt with like any name of a formal argument of a regular method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Running public static void main string args from the command line&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;public static void main string args running without command line
      parameters&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;Here we will run the program above from within the command line.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;In order to follow the examples, you need to set the JAVA_HOME, classpath
    and add java to the path variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;In order to set your environment, please feel free to check our tutorial:&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-development-tools-install.html&quot; target=&quot;_blank&quot;&gt;install the necessary tools&lt;/a&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;We should follow those steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;
  &lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;1)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot;&gt;We begin by saving the program above in a file called: TestMain.java.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt;&quot;&gt;
  &lt;span lang=&quot;EN-US&quot;&gt;Note that the name of the file must match the name of the public class
    contained in that file. Also, a source file in java contains no more than
    one public class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;
  &lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span&gt;2)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot;&gt;we put this file in this path: C:\program1\TestMain.java&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt86xOObfPZV0uuOP6S427rhlQWHwLfiQqzNEEailNzwDMVIKfp_MBsSJUcKSCrjsAMRIplJrCf76RmjJqc6kA43fJkduAwfzN_wmIuhLPCC0pZ7uL87TfSodX_KcGcrLtp3vDV60vY0c/s638/public-static-void-main-string-args-step1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;public static void main string arguments step1&quot; border=&quot;0&quot; data-original-height=&quot;412&quot; data-original-width=&quot;638&quot; height=&quot;207&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt86xOObfPZV0uuOP6S427rhlQWHwLfiQqzNEEailNzwDMVIKfp_MBsSJUcKSCrjsAMRIplJrCf76RmjJqc6kA43fJkduAwfzN_wmIuhLPCC0pZ7uL87TfSodX_KcGcrLtp3vDV60vY0c/w320-h207/public-static-void-main-string-args-step1.jpg&quot; title=&quot;public static void main string arguments step1&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;3) We open the command line (cmd) and we type those commands&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;4) cd C:\program1&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHR0RoBJXYT1TiHk56LBr3d-PqaFfFGMv-DmbF-c9glVbW5WuCbTjWuHcfFcC5lBriZkfW87Nn-ltjb87NhqOQ3yqefcTbUBGbv1NR8nMBjF70IGmDY1x2F2FGMyiR3b6BEhHk-HZgIJU/s573/public-static-void-main-string-args-step2.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;public static void main string arguments step2&quot; border=&quot;0&quot; data-original-height=&quot;203&quot; data-original-width=&quot;573&quot; height=&quot;141&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHR0RoBJXYT1TiHk56LBr3d-PqaFfFGMv-DmbF-c9glVbW5WuCbTjWuHcfFcC5lBriZkfW87Nn-ltjb87NhqOQ3yqefcTbUBGbv1NR8nMBjF70IGmDY1x2F2FGMyiR3b6BEhHk-HZgIJU/w400-h141/public-static-void-main-string-args-step2.jpg&quot; title=&quot;public static void main string arguments step2&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;5)&lt;span style=&quot;font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot;&gt;javac
TestMain.java&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3947G2VjO1Tcqv00JCYjOARBoV9VkmpHtACVtp9aAg8tGfIwt0W0JKkQ1PrC67JZ89fDcsJ148a9nNmz3jatEsMLnXPtsajhhgegNzjJwGwgPYeFZM9wlZEZXt6QYkfWdc8ubGkzXnLE/s573/public-static-void-main-string-args-step3.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;public static void main string args step3&quot; border=&quot;0&quot; data-original-height=&quot;203&quot; data-original-width=&quot;573&quot; height=&quot;141&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3947G2VjO1Tcqv00JCYjOARBoV9VkmpHtACVtp9aAg8tGfIwt0W0JKkQ1PrC67JZ89fDcsJ148a9nNmz3jatEsMLnXPtsajhhgegNzjJwGwgPYeFZM9wlZEZXt6QYkfWdc8ubGkzXnLE/w400-h141/public-static-void-main-string-args-step3.jpg&quot; title=&quot;public static void main string args step3&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;6)&lt;span style=&quot;font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot;&gt;java
-classpath . TestMain&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;

&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; The output
of the program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36pt; text-indent: -18pt;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqBU9ogZTbVtlvdbHs5bD_FuQ7simPtiNyBUr2Xk4WCaUTmydi2SQgXV1chM1SjmBDkLoG7h5D1uXtvuWATJxk6MiF4U118cGHh-elESXcdTxMAqCMoYgHRymZTSG5uK0aYd-ApTOd-f0/s621/public-static-void-main-string-args-step4.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;public static void main string args step5&quot; border=&quot;0&quot; data-original-height=&quot;215&quot; data-original-width=&quot;621&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqBU9ogZTbVtlvdbHs5bD_FuQ7simPtiNyBUr2Xk4WCaUTmydi2SQgXV1chM1SjmBDkLoG7h5D1uXtvuWATJxk6MiF4U118cGHh-elESXcdTxMAqCMoYgHRymZTSG5uK0aYd-ApTOd-f0/w400-h139/public-static-void-main-string-args-step4.jpg&quot; title=&quot;public static void main string args step5&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In step 5,
we compiled the class TestMain. After launching this command, we notice that we
have an extra file in the C:\program1 directory.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDZBcx-sEUZQj1IEiM45JruVs_kgxL94y3MgviGo4wNDtXLNvfMGC0gKiFAr5ml8XlheYmPLItwx6PNT33eZqelwyDUXgdiH474k_VkSdGFhNBfo3u2EqeJta8GCuamgzxgohtBmQefqQ/s638/public-static-void-main-string-args-step5.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;public static void main string arguments step5&quot; border=&quot;0&quot; data-original-height=&quot;412&quot; data-original-width=&quot;638&quot; height=&quot;259&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDZBcx-sEUZQj1IEiM45JruVs_kgxL94y3MgviGo4wNDtXLNvfMGC0gKiFAr5ml8XlheYmPLItwx6PNT33eZqelwyDUXgdiH474k_VkSdGFhNBfo3u2EqeJta8GCuamgzxgohtBmQefqQ/w400-h259/public-static-void-main-string-args-step5.jpg&quot; title=&quot;public static void main string arguments step5&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This file
contains the byte code generated after compiling the class TestMain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In step 6,
the java command invokes the JVM. The latter will run the compiled version of
the class TestMain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;public
static void main string arguments running with command line parameters&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This is our
java program:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;public class TestMainWithArguments {&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public
static void main(String[] args) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int
i = 0; i&amp;lt; args.length; i++){&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;Hello
&quot;+ args[i]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;font color=&quot;#41b375&quot;&gt;}&lt;/font&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;In this
section, we just repeat the same steps until step 6.&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In fact, we
just replace TestMain with TestMainWithArguments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In step 6,
we will run this command:&amp;nbsp; java
-classpath . TestMainWithArguments john peter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Here, we
passed two parameters to our public static void main string args method: john
and peter.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The
arguments are separated by a space.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The output
of this program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ1HQAACFwHDRhdwSkTVTwKEZE2kCrVSDvyZBDqa1W0vVk-0-xBBYc3jrdI5pMFMj9Sf0gMKA-imdEGtkVGNIrFkvN4vFCDlDRQ64ejDe8agNJc6Io8qb4Amz7SjTtrVQp1XoTUUIhpY0/s621/public-static-void-main-string-args-step6.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;215&quot; data-original-width=&quot;621&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ1HQAACFwHDRhdwSkTVTwKEZE2kCrVSDvyZBDqa1W0vVk-0-xBBYc3jrdI5pMFMj9Sf0gMKA-imdEGtkVGNIrFkvN4vFCDlDRQ64ejDe8agNJc6Io8qb4Amz7SjTtrVQp1XoTUUIhpY0/w400-h139/public-static-void-main-string-args-step6.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;This&amp;nbsp;&lt;/span&gt;&lt;/font&gt;tutorial that explains&lt;font style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;&lt;b&gt;&lt;font color=&quot;#ff0000&quot;&gt;&amp;nbsp;&lt;/font&gt;what is&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;public static void main string arguments&lt;/b&gt; arrives at its end.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Please don’t forget to subscribe to like our&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;Program In JAVA&lt;/a&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;b style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;Facebook page&lt;/b&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt; or to subscribe to our &lt;/span&gt;&lt;/font&gt;&lt;b style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;newsletter&lt;/b&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt; to get our latest JAVA
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;To check our&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;font face=&quot;Times New Roman, serif&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;, please check this link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;See you in the next &lt;b&gt;core java tutorial&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><link>https://javasneo.blogspot.com/2020/06/public-static-void-main-string-arguments.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinHNFhrF8jwedmnyiCU9UyPi9RYp9CXoDWMHaAqTatn_kGXQFrNuDBRfxjp07KOgi30w01VNznlgh08QhIwVzIn1JoOiSB2ejiZzygOvSNFsUCOkuI0q-seFBQW36dt7gH1hUYY6XBGh4/s72-w400-h245-c/public-static-void-main-args-java.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-5524543004689467735</guid><pubDate>Mon, 08 Jun 2020 17:11:00 +0000</pubDate><atom:updated>2020-06-27T16:29:06.874+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quartz</category><category domain="http://www.blogger.com/atom/ns#">Spring Batch</category><category domain="http://www.blogger.com/atom/ns#">spring boot 2 Quartz</category><category domain="http://www.blogger.com/atom/ns#">Spring boot2</category><title>Spring boot batch quartz scheduler example</title><description>This Spring boot batch quartz scheduler example tutorial presents step by step how to integrate Spring Boot 2, Spring Batch and Quartz using H2 database.&lt;h2 style=&quot;text-align: left;&quot;&gt;Spring Boot Spring Batch Quartz Scheduler Integration example&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;In fact, we will create an application which reads
data from a database table (CUSTOMER_INPUT) and writes this data in another
table CUSTOMER_OUTPUT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The two tables have the same columns.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;text-indent: -18pt;&quot;&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;ID&amp;nbsp;: primary key&lt;/li&gt;&lt;li&gt;Firstname&amp;nbsp;: String&lt;/li&gt;&lt;li&gt;Lastname&amp;nbsp;: String&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The project overview is the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUIHBeiDeK5jdY_yH1ZxcA0sQVzoqAzB7U6gOYcdgD9hJJDMF3p7gF2xyM60QE4eOm21L90pgaVZFs-HHo30mnzihCHrpUAdy2aFOOynkZ0yrikwU_bcb_1vhD2EMGNicU5cXH_Cne274/s546/spring-boot-spring-batch-quartz-integration.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Spring boot spring batch quartz integration&quot; border=&quot;0&quot; data-original-height=&quot;546&quot; data-original-width=&quot;421&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUIHBeiDeK5jdY_yH1ZxcA0sQVzoqAzB7U6gOYcdgD9hJJDMF3p7gF2xyM60QE4eOm21L90pgaVZFs-HHo30mnzihCHrpUAdy2aFOOynkZ0yrikwU_bcb_1vhD2EMGNicU5cXH_Cne274/w309-h400/spring-boot-spring-batch-quartz-integration.PNG&quot; title=&quot;Spring boot spring batch quartz integration&quot; width=&quot;309&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;!--[if !supportLists]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;text-indent: -18pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Spring batch&lt;/b&gt; is used to read data from the table
CUSTOMER_INPUT and store it in the table CUSTOMER_OUTPUT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;So, in &lt;i&gt;spring batch&lt;/i&gt; we have a custom reader that reads data
from CUSTOMER_INPUT using pagination and a custom writer that writes data into
CUSTOMER_OUTPUT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Here, we have no processor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The code of the domain objects is the following&amp;nbsp;:&lt;/p&gt;


&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;CustomerInput.java&lt;/b&gt;&lt;/h2&gt;

&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch.domain;

import javax.persistence.*;

public class CustomerInput {

  @Id
  private long id;

  private String firstName;

  private String lastName;

  public CustomerInput() {
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public CustomerInput(long id, String firstName, String lastName) {
    this.id = id;
    this.firstName = firstName;
    this.lastName = lastName;
  }

  @Override
  public String toString() {
    return &quot;CustomerInput{&quot; +
      &quot;id=&quot; + id +
      &quot;, firstName=&#39;&quot; + firstName + &#39;\&#39;&#39; +
      &quot;, lastName=&#39;&quot; + lastName + &#39;\&#39;&#39; +
      &#39;}&#39;;
  }
}&lt;/pre&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;CustomerOutput.java&lt;/b&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch.domain;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

public class CustomerOutput {
  @Id
  private long id;

  private String firstName;

  private String lastName;

  public CustomerOutput() {
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public CustomerOutput(long id, String firstName, String lastName) {
    this.id = id;
    this.firstName = firstName;
    this.lastName = lastName;
  }

  @Override
  public String toString() {
    return &quot;CustomerOutput{&quot; +
      &quot;id=&quot; + id +
      &quot;, firstName=&#39;&quot; + firstName + &#39;\&#39;&#39; +
      &quot;, lastName=&#39;&quot; + lastName + &#39;\&#39;&#39; +
      &#39;}&#39;;
  }
}
&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;The row mapper that maps every row in the CUSTOMER_INPUT
table to a CustomerInput object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;CustomerRowMapper.java&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch.domain;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;


public class CustomerRowMapper implements RowMapper&lt;customerinput&gt; {
  @Override
  public CustomerInput mapRow(ResultSet resultSet, int i) throws SQLException {
    return new CustomerInput(resultSet.getLong(&quot;ID&quot;),
      resultSet.getString(&quot;FIRSTNAME&quot;),
      resultSet.getString(&quot;LASTNAME&quot;));
  }
}
&lt;/customerinput&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The configuration of &lt;b&gt;Spring batch&lt;/b&gt; is in the JobConfiguration
class&amp;nbsp;:&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b style=&quot;text-align: center;&quot;&gt;JobConfiguration.java&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch.configuration;

import java.util.HashMap;
import java.util.Map;

import javax.sql.DataSource;

import io.spring.batch.domain.CustomerInput;
import io.spring.batch.domain.CustomerOutput;
import io.spring.batch.domain.CustomerRowMapper;

import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider;
import org.springframework.batch.item.database.JdbcBatchItemWriter;
import org.springframework.batch.item.database.JdbcPagingItemReader;
import org.springframework.batch.item.database.Order;
import org.springframework.batch.item.database.support.MySqlPagingQueryProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Michael Minella
 */
@Configuration
public class JobConfiguration {

  @Autowired
  public JobBuilderFactory jobBuilderFactory;

  @Autowired
  public StepBuilderFactory stepBuilderFactory;

  @Autowired
  public DataSource dataSource;

  @Bean
  public JdbcPagingItemReader&lt;customerinput&gt; pagingItemReader() {
    JdbcPagingItemReader&lt;customerinput&gt; reader = new JdbcPagingItemReader&amp;lt;&amp;gt;();

    reader.setDataSource(this.dataSource);
    reader.setFetchSize(10);
    reader.setRowMapper(new CustomerRowMapper());

    MySqlPagingQueryProvider queryProvider = new MySqlPagingQueryProvider();
    queryProvider.setSelectClause(&quot;ID, FIRSTNAME, LASTNAME&quot;);
    queryProvider.setFromClause(&quot;from CUSTOMER_INPUT&quot;);

    Map&lt;string order=&quot;&quot;&gt; sortKeys = new HashMap&amp;lt;&amp;gt;(1);

    sortKeys.put(&quot;ID&quot;, Order.ASCENDING);

    queryProvider.setSortKeys(sortKeys);

    reader.setQueryProvider(queryProvider);

    return reader;
  }

  @Bean
  public JdbcBatchItemWriter&lt;customeroutput&gt; customerItemWriter() {
    JdbcBatchItemWriter&lt;customeroutput&gt; itemWriter = new JdbcBatchItemWriter&amp;lt;&amp;gt;();

    itemWriter.setDataSource(this.dataSource);
    itemWriter.setSql(&quot;INSERT INTO CUSTOMER_OUTPUT(FIRSTNAME,LASTNAME) VALUES (:firstName, :lastName)&quot;);
    itemWriter.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider());
    itemWriter.afterPropertiesSet();
    return itemWriter;
  }

  @Bean
  public Step step1() {
    return stepBuilderFactory.get(&quot;step1&quot;)
      .&lt;customerinput customeroutput=&quot;&quot;&gt;chunk(10)
      .reader(pagingItemReader())
      .writer(customerItemWriter())
      .build();
  }

  @Bean
  public Job job() {
    return jobBuilderFactory.get(&quot;job&quot;)
      .start(step1())
      .build();
  }
}
&lt;/customerinput&gt;&lt;/customeroutput&gt;&lt;/customeroutput&gt;&lt;/string&gt;&lt;/customerinput&gt;&lt;/customerinput&gt;&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;Here, the job Spring batch is composed by a single step that
reads the data from CUSTOMER_INPUT and writes it in CUSTOMER_OUTPUT.&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The custom &lt;b&gt;Quartz &lt;/b&gt;job is the following&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;QuartzJobLauncher.java&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch.quartz;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.configuration.JobLocator;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.launch.NoSuchJobException;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class QuartzJobLauncher extends QuartzJobBean {

  private String jobName;
  private JobLauncher jobLauncher;
  private JobLocator jobLocator;

  public String getJobName() {
    return jobName;
  }

  public void setJobName(String jobName) {
    this.jobName = jobName;
  }

  public JobLauncher getJobLauncher() {
    return jobLauncher;
  }

  public void setJobLauncher(JobLauncher jobLauncher) {
    this.jobLauncher = jobLauncher;
  }

  public JobLocator getJobLocator() {
    return jobLocator;
  }

  public void setJobLocator(JobLocator jobLocator) {
    this.jobLocator = jobLocator;
  }

  @Override
  protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
    JobParameters jobParameters = new JobParametersBuilder().addLong(&quot;time&quot;, System.currentTimeMillis()).toJobParameters();

    try
    {
      ApplicationContext applicationContext = (ApplicationContext) context.getScheduler().getContext().get(&quot;applicationContext&quot;);
      jobLocator = (JobLocator) applicationContext.getBean(JobLocator.class);
      jobLauncher = (JobLauncher) applicationContext.getBean(JobLauncher.class);
      Job job = jobLocator.getJob(jobName);
      JobParameters params = new JobParametersBuilder()
        .addString(&quot;JobID&quot;, String.valueOf(System.currentTimeMillis()))
        .toJobParameters();

      jobLauncher.run(job, params);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

&lt;/pre&gt;

&lt;pre style=&quot;background: white;&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The &lt;i&gt;Quartz configuration&lt;/i&gt; is presented in the following file&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;QuartzConfig.java&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch.configuration;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import io.spring.batch.quartz.QuartzJobLauncher;
import org.quartz.*;
import org.springframework.batch.core.configuration.JobLocator;
import org.springframework.batch.core.configuration.JobRegistry;
import org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
import org.springframework.scheduling.quartz.JobDetailFactoryBean;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

import static org.quartz.CronScheduleBuilder.cronSchedule;

@Configuration
public class QuartzConfig {

  @Autowired
  private JobLauncher jobLauncher;

  @Autowired
  private JobLocator jobLocator;

  @Value(&quot;${cronExpression}&quot;)
  private String cronExpression;

  @Bean
  public JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor(JobRegistry jobRegistry) {
    JobRegistryBeanPostProcessor jobRegistryBeanPostProcessor = new JobRegistryBeanPostProcessor();
    jobRegistryBeanPostProcessor.setJobRegistry(jobRegistry);

    return jobRegistryBeanPostProcessor;
  }

  @Bean
  public JobDetail jobDetail() {
    //Set Job data map
    JobDataMap jobDataMap = new JobDataMap();
    jobDataMap.put(&quot;jobName&quot;, &quot;job&quot;);

    return JobBuilder.newJob(QuartzJobLauncher.class)
      .withIdentity(&quot;job&quot;,null)
      .setJobData(jobDataMap)
      .storeDurably()
      .build();
  }

  @Bean
  public Trigger jobTrigger()
  {
    return TriggerBuilder
      .newTrigger()
      .forJob(jobDetail())
      .withIdentity(&quot;jobTrigger&quot;,null)
      .withSchedule(cronSchedule(cronExpression))
      .build();
  }

  @Bean
  public SchedulerFactoryBean schedulerFactoryBean() throws IOException, SchedulerException
  {
    SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
    scheduler.setTriggers(jobTrigger());
    scheduler.setQuartzProperties(quartzProperties());
    scheduler.setJobDetails(jobDetail());
    scheduler.setApplicationContextSchedulerContextKey(&quot;applicationContext&quot;);
    return scheduler;
  }

  public Properties quartzProperties() throws IOException
  {
    PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
    propertiesFactoryBean.setLocation(new ClassPathResource(&quot;/application.properties&quot;));
    propertiesFactoryBean.afterPropertiesSet();
    return propertiesFactoryBean.getObject();
  }
}
&lt;/pre&gt;
&lt;pre style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;The main class is the SpringQuartzIntegration class. It is the entry point to the app.&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;SpringQuartzIntegration.java&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;package io.spring.batch;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;

/**
 * Created by Abderrahmen on 08/06/2020.
 */
@SpringBootApplication
@EnableBatchProcessing(modular = false)
@EntityScan(&quot;io.spring.batch.domain&quot;)
public class SpringQuartzIntegration {
  public static void main(String[] args) {
    SpringApplication.run(SpringQuartzIntegration.class, args);
  }
}

&lt;/pre&gt;

&lt;pre style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;The application.properties file is the following&amp;nbsp;:&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;application.properties&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;spring.datasource.url=jdbc:h2:file:~/spring-boot-h2-db;DATABASE_TO_UPPER=false
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=ha
spring.datasource.password=ha
spring.h2.console.enabled=true
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
#spring.batch.job.enabled =false
spring.h2.console.path=/h2
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

spring.application.name=batch purge
logging.level.org.springframework.cloud.task=DEBUG

scheduler.enabled=true
cronExpression=*/10 * * * * ? *

# Spring Batch properties
spring.batch.job.enabled=false

#Quartz
#Quartz persistent jobStore config
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix=QRTZ_   
org.quartz.jobStore.dataSource=myDS
#org.quartz.jobStore.useProperties=false
org.quartz.jobStore.isClustered=false

#Quartz dataSource
org.quartz.dataSource.myDS.driver=org.h2.Driver
#org.quartz.dataSource.myDS.URL=jdbc:h2:file:~/h2/testdb;INIT=RUNSCRIPT FROM &#39;classpath:schema-quartz.sql&#39;
#org.quartz.dataSource.myDS.URL=jdbc:h2:file:~/spring-boot-h2-db;DB_CLOSE_ON_EXIT=FALSE;MODE=PostgreSQL
org.quartz.dataSource.myDS.URL=jdbc:h2:file:~/h2/testdb;INIT=RUNSCRIPT FROM &#39;classpath:schema-quartz.sql&#39;
org.quartz.dataSource.myDS.user=ha
org.quartz.dataSource.myDS.password =ha
org.quartz.dataSource.myDS.maxConnections=5
org.quartz.dataSource.myDS.validationQuery=select 1
spring.quartz.jdbc.comment-prefix=#
#spring.quartz.jdbc.initialize-schema = never
spring.quartz.job-store-type= jdbc
org.quartz.jobStore.useProperties= false
&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;Here the metadata tables of Spring batch are stored in a H2
database presented by the file spring-boot-h2-db&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;While the metadata of Quartz are written in another H2
database stored in the file testdb.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The file data.sql is used to insert data in the
CUSTOMER_INPUT table when the app starts&amp;nbsp;:&lt;b style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;data.sql&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;INSERT INTO CUSTOMER_INPUT (FIRSTNAME,LASTNAME) VALUES (&#39;Reed&#39;,&#39;Edwards&#39;);
&lt;/pre&gt;
&lt;pre style=&quot;background: white;&quot;&gt;&lt;br /&gt;&lt;/pre&gt;The file schema.sql contain the creation script of the CUSTOMER_INPUT and the CUSTOMER_OUTPUT tables.&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Schema.sql&lt;/b&gt;&lt;/h2&gt;
&lt;pre class=&quot;code-box short-b&quot;&gt;DROP TABLE IF EXISTS CUSTOMER_INPUT;
DROP TABLE IF EXISTS CUSTOMER_OUTPUT;

CREATE TABLE CUSTOMER_INPUT (
  ID INTEGER NOT NULL auto_increment,
  FIRSTNAME CHARACTER(255) default NULL,
  LASTNAME CHARACTER(255) default NULL,
  PRIMARY KEY (ID)
);

CREATE TABLE CUSTOMER_OUTPUT (
  ID INTEGER NOT NULL auto_increment,
  FIRSTNAME CHARACTER(255) default NULL,
  LASTNAME CHARACTER(255) default NULL,
  PRIMARY KEY (ID)
);
&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The file schema-quartz.sql contain the creation script of
the metadata tables of &lt;b&gt;Quartz&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;schema-quartz.sql&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;The pom.xml is the following&amp;nbsp;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Pom.xml&lt;/b&gt;&lt;/h2&gt;&lt;pre style=&quot;background: white;&quot;&gt;&lt;i&gt;&amp;lt;?&lt;/i&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: blue;&quot;&gt;xml version&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: green;&quot;&gt;=&quot;1.0&quot; &lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: blue;&quot;&gt;encoding&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: green;&quot;&gt;=&quot;UTF-8&quot;&lt;/span&gt;&lt;/b&gt;&lt;i&gt;?&amp;gt;&lt;br /&gt;
&lt;/i&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;project &lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: blue;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: green;&quot;&gt;=&quot;http://maven.apache.org/POM/4.0.0&quot; &lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: blue;&quot;&gt;xmlns:&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: #660e7a;&quot;&gt;xsi&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: green;&quot;&gt;=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: #660e7a;&quot;&gt;xsi&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: blue;&quot;&gt;:schemaLocation&lt;/span&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: green;&quot;&gt;=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;modelVersion&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;4.0.0&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;modelVersion&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;io.spring.batch&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;batch-integration&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;packaging&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;jar&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;packaging&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;2.3.0-SNAPSHOT&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;description&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;Batch Integration&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;description&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;name&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;Batch Quartz integration&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;name&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;parent&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-parent&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;2.3.0.RELEASE&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;relativePath&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;parent&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;properties&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;project.build.sourceEncoding&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;UTF-8&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;project.build.sourceEncoding&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;java.version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;1.8&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;java.version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;properties&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependencies&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-batch&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;com.h2database&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;h2&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;scope&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;runtime&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;scope&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-data-jpa&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.quartz-scheduler&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;quartz&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.springframework&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;spring-context-support&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-test&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;scope&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;test&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;scope&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;com.mchange&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;c3p0&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;0.9.5.2&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;version&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependency&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;dependencies&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;build&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;plugins&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;plugin&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;groupId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;spring-boot-maven-plugin&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;artifactId&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;plugin&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;plugins&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;build&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;background: rgb(239, 239, 239); color: navy;&quot;&gt;project&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;background: rgb(239, 239, 239);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;Here we arrived at the end of the &lt;b&gt;spring boot 2, Spring
batch and Quartz integration tutorial&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;In order to check our &lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;, please like our &lt;b&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;howto program&lt;/a&gt;&lt;/b&gt; facebook page and subscribe to our newsletter to get our latest
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;







































































































&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;To download the project of this tutorial, please check my &lt;b&gt;&lt;a href=&quot;https://github.com/abenmariem/spring-batch-boot&quot; target=&quot;_blank&quot;&gt;Github&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/how-to-integrate-spring-boot-spring-batch-quartz.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUIHBeiDeK5jdY_yH1ZxcA0sQVzoqAzB7U6gOYcdgD9hJJDMF3p7gF2xyM60QE4eOm21L90pgaVZFs-HHo30mnzihCHrpUAdy2aFOOynkZ0yrikwU_bcb_1vhD2EMGNicU5cXH_Cne274/s72-w309-h400-c/spring-boot-spring-batch-quartz-integration.PNG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-7338381398513616348</guid><pubDate>Sat, 06 Jun 2020 15:38:00 +0000</pubDate><atom:updated>2020-12-19T16:01:56.209+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><category domain="http://www.blogger.com/atom/ns#">define interface in java</category><category domain="http://www.blogger.com/atom/ns#">interface java</category><category domain="http://www.blogger.com/atom/ns#">java interface</category><title>what is java interface tutorial</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXxAm04fm7A3mXPbWVOEtkm7IR0bytNL0Kfh-NpRy7iHTpxFlV4hDNuXo_E5wV82OE-c3wQYcqvzWBBMQ8xOdgJhecYMEGrrl0-P7pebznljVU_LIXUQ0vwI-wO278NufohkSrE0F_fNY/s522/java-interface-tutorial.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;java interface tutorial&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXxAm04fm7A3mXPbWVOEtkm7IR0bytNL0Kfh-NpRy7iHTpxFlV4hDNuXo_E5wV82OE-c3wQYcqvzWBBMQ8xOdgJhecYMEGrrl0-P7pebznljVU_LIXUQ0vwI-wO278NufohkSrE0F_fNY/w400-h245/java-interface-tutorial.jpg&quot; title=&quot;java interface tutorial&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;Java interface introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;JAVA
interface&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt; is an
important concept in the java programming language.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This &lt;i&gt;java
interface tutorial&lt;/i&gt; will dive in depth into this concept and explain it with
many examples.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In a
previous tutorial, we learned&amp;nbsp;&lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/what-is-java-abstract-class.html&quot; target=&quot;_blank&quot;&gt;what is an abstract class in java&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;A java
interface is like an abstract class that has only:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;final attributes (constant)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;no full implemented methods (only abstract
     methods)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In fact, an
interface in java has only:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;final attributes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;abstract methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In
addition, an interface may inherit from many &lt;b&gt;java interfaces&lt;/b&gt; unlike
classes that have to inherit from a unique parent class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In java,
multiple inheritances in the context of classes is not allowed while it is
allowed for interfaces.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;If you
don’t know what the concept of inheritance is, please feel free to check our&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;a href=&quot;https://www.blogger.com/#&quot;&gt;java inheritance tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Also, a
class can implement many interfaces with no problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;JAVA interface definition (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The syntax
of a &lt;i&gt;java interface&lt;/i&gt; is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;interface
I {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//final
attributes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;final
int a =100; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;final
static int b = 300;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//abstract
methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;public
abstract int&lt;span&gt;&amp;nbsp; &lt;/span&gt;f(float p);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The only
visibilities that can be applied to an interface are public or nothing (package
visibility).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This is the
same rule applied for&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java classes&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;By default,
the methods declared in an interface are public and abstract.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;So, we can
omit to mention the keywords public and abstract in the signatures of the
interface ‘s methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;But, we
recommend mentioning these two keywords in the signature of the methods because
it is a best practice.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;JAVA interface implemented by a class (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;When
defining a class, we can mention that it implements an interface using this
syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;class
A implements I {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//
The class A must implement all the methods of the interface I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The class A
must implement all the methods of the interface I.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Otherwise,
we will get a compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In
conclusion, when a class implements an interface, we are sure that it
implements all the methods present in that interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;So, the
java interface is like a contract that the class will respect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In the
following, we will present a class that implements two interfaces. It may
implement more than two interfaces. But in our case we will take the example of
two interfaces.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This is the
second interface:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;interface
J {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//abstract
methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;public
abstract float&lt;span&gt;&amp;nbsp; &lt;/span&gt;g();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This is the
class B that implements the interfaces I and J:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;class
B implements I, J {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//
The class A must implement all the methods of the interfaces I and J&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Here, the
class B implements two interfaces (I and J) separated by comma.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;It must
implement all the methods of the interfaces I and J.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;If a class
implements an interface, it can access any constant defined by this interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;If the
constant defined in an interface is static, it can be accessed directly using
the name of the interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;So, the
constant b defined in the interface I can be accessed like this: I.b&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;JAVA interface implemented by a class (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;If you are
not familiar with polymorphism, you can check our &lt;span style=&quot;background: yellow;&quot;&gt;java polymorphism tutorial&lt;/span&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In context
of inheritance, we can declare a variable of a parent type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Then, we
can assign to it an object of a child type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;We can do
something like that using an &lt;b&gt;interface in java&lt;/b&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;I
a;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;We can
declare a variable whose type is an interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Also, we
can assign any class that implements the interface I to the variable a.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;So, we can
assign an object of type A to the variable a:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;a
= new A();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In fact, we
can even assign a &lt;span style=&quot;background: yellow;&quot;&gt;java
anonymous class&lt;/span&gt; to the variable a.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;The inheritance between java interfaces (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;An
interface can inherit from many interfaces unlike the classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;So,
multiple inheritance between interfaces is allowed in java.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;An
interface that inherits from two other interfaces I and J contains all the
declarations of all the methods of I an J.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Java
interface inheritance is a simple grouping of method declarations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;interface
K extends I, J {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//contains
the declaration of all the methods of both I an J&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;JAVA interfaces and naming conflicts (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Let’s
consider the following example.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This is the
first interface:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;interface
P {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;public
abstract int&lt;span&gt;&amp;nbsp; &lt;/span&gt;l(int a);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;public
abstract void&lt;span&gt;&amp;nbsp; &lt;/span&gt;q();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This is the
second interface:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;interface
M {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//abstract
methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;public
abstract int&lt;span&gt;&amp;nbsp; &lt;/span&gt;l(float a);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;public
abstract void&lt;span&gt;&amp;nbsp; &lt;/span&gt;q();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Let’s
consider the T class that implements the two interfaces P and M:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;class
T implements P, M {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;In this
case, the class T must implement these methods:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The method l of the interface P&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The method l of the interface Q&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The method q (because it has the same
     signature in the two interfaces)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The method
l is implemented in the class T two times because the two signatures of this
method in the two interfaces respect&amp;nbsp;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/method-overloading-in-java.html&quot; target=&quot;_blank&quot;&gt;java method overloading&lt;/a&gt;&amp;nbsp;rules.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;JAVA interfaces and default method implementation
in JAVA 8 (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;JAVA 8
allows to an interface to give a default implementation for a method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;The syntax
is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;interface
D {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;default
int f(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;//default
implementation of the interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Here, a
class that implements the D interface may or may not give an implementation of
the method f(). In the second case, it will use the default implementation
offered by the interface D.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14pt; line-height: 115%;&quot;&gt;Java interface: conclusion (h2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;This &lt;b&gt;java
interface tutorial&lt;/b&gt; arrives at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;We have
explained the&lt;b&gt; interface concept with many examples&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;If this
java tutorial was helpful for you, please check our &lt;/span&gt;&lt;a href=&quot;http://how-to-program-in-java.com/core-java-tutorial/&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;core java tutorial&lt;/span&gt;&lt;/a&gt;&lt;span lang=&quot;EN-US&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;You can
like our &lt;/span&gt;&lt;a href=&quot;http://www.facebook.com/howtoprograminjava/&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;how to program&lt;/span&gt;&lt;/a&gt;&lt;span lang=&quot;EN-US&quot;&gt; facebook page for more tutorials or
follow our &lt;/span&gt;&lt;a href=&quot;https://plus.google.com/u/0/+Howtoprogramforbeginners&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;how to program&lt;/span&gt;&lt;/a&gt;&lt;span lang=&quot;EN-US&quot;&gt; Google plus page.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/what-is-java-interface-tutorial.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXxAm04fm7A3mXPbWVOEtkm7IR0bytNL0Kfh-NpRy7iHTpxFlV4hDNuXo_E5wV82OE-c3wQYcqvzWBBMQ8xOdgJhecYMEGrrl0-P7pebznljVU_LIXUQ0vwI-wO278NufohkSrE0F_fNY/s72-w400-h245-c/java-interface-tutorial.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-8158261054733231772</guid><pubDate>Sat, 06 Jun 2020 15:31:00 +0000</pubDate><atom:updated>2020-12-05T19:54:59.628+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">abstract in oops</category><category domain="http://www.blogger.com/atom/ns#">abstract keyword in java</category><category domain="http://www.blogger.com/atom/ns#">abstraction in java</category><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><category domain="http://www.blogger.com/atom/ns#">java abstract class</category><category domain="http://www.blogger.com/atom/ns#">java abstract class example</category><category domain="http://www.blogger.com/atom/ns#">public abstract class</category><category domain="http://www.blogger.com/atom/ns#">use of abstract class in java</category><title>What is JAVA abstract Class</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNVubs4j5-rULIxW6yI0MravTsb_VTkqVzcAbqpPnoiqEeX6laGfhBISL3g_PnC3boiZfDIDWb7NK0FGlhiSoizF8OS7xGHGvj2ctUi_OB7cZ3x9vZfpadiP3j1a_B7eebRKsLprqcIyM/s522/java-abstract-class-tutorial.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;What is java abstract class&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNVubs4j5-rULIxW6yI0MravTsb_VTkqVzcAbqpPnoiqEeX6laGfhBISL3g_PnC3boiZfDIDWb7NK0FGlhiSoizF8OS7xGHGvj2ctUi_OB7cZ3x9vZfpadiP3j1a_B7eebRKsLprqcIyM/w400-h245/java-abstract-class-tutorial.jpg&quot; title=&quot;What is java abstract class&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Java abstract class introduction&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Java
abstract class&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt; is a
class that cannot be instantiated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;We may say
that this type of&amp;nbsp;java class&amp;nbsp;is useless because we cannot create instances from a &lt;i&gt;java abstract class&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;But, the
concept of abstract class is very useful in object oriented programming.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;We covered also other OOP concepts like th&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;e encapsulation,the polymorphism and the abstraction.&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;An &lt;b&gt;abstract
class&lt;/b&gt; is manned to be a parent class. It is created to be used for
inheritance as a base class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;An abstract
class is declared like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Abstract class A {}&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;This type
of classes may have methods and attributes that are inherited by child classes:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;Abstract class A {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;type1 attr1;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;type2 attr2;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;public type3&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;f(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;public abstract Type1 g();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;













&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;A java
abstract class can have fully implemented methods or methods that have no
implementations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;A method
declared with its signature and have no implementation is called an abstract
method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;In the
example above, the method g() is an abstract method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;It has the
abstract keyword in its signature.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;The method
f() is not an abstract method because we opened and closed the curl braces even
if its implementation is empty.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;We can
declare a variable of type A but we cannot instantiate an object of type A.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;A variable1; //OK&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;But, we
cannot create an object of type A.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;A variable2 = new A(); //compiler error&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Let’s
define a child class B that inherits from class A and implements the abstract
method g():&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;class B extends A {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;public Type1 g(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;







&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;In the
class B, the method g() inherited from class A is no longer abstract. So, the
class B hasn’t any abstract methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Therefore,
it is not abstract and we can instantiate it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;This line
of code is correct:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;B variable3
= new B ();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Or using
the &lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;polymorphism principle&lt;/span&gt;,
we can do like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;A variable4 = new B (); //OK&lt;/span&gt;&lt;/pre&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Java abstract class characteristics&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-bidi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;1)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;A
java class is abstract if it contains one or many abstract methods. The
abstract keyword in the class declaration is not mandatory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;margin-left: 36pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;class A {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;public abstract Type1 g();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-bidi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;2)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;An
abstract method must be public&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-bidi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;3)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;In
an abstract method, the names of formal arguments of the method are mandatory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;margin-left: 36pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;class A {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;public abstract Type1 g(int); //compiler error&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-bidi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;4)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;A
child class that inherits from an abstract class must define all the abstract
methods of its parent class in order to be not abstract.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-bidi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;5)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;If
a child class that inherits from an abstract class doesn’t implement one
abstract method, it is abstract and it cannot be instanciated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US; mso-bidi-font-family: Calibri;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;6)&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Abstract classes&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt; cannot have abstract constructors&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Java abstract class use cases&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Abstract class in java&lt;/b&gt; is
important in the Object oriented design.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;We can use it like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;We put the common state of child classes
     inside the parent abstract class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Implement the methods that have the same
     implementation for all child classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Keep the methods that are specific to each
     child class as abstracts. In this way, the child class is responsible for
     providing its own implementation for its parent‘s abstract methods.
     Otherwise, it will be abstract. It will override its parent class‘s
     abstract classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Java abstract class example&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;In this
example, we will create an abstract class called Shape that has two child
classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Those child
classes are: Circle and Square.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;The code of
the abstract class Shape is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;abstract&lt;/b&gt; &lt;b&gt;class&lt;/b&gt; Shape {&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;protected&lt;/b&gt; String name;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; Shape() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.name =&quot;shape&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; Shape(String name) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.name = name;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; String getName() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;return&lt;/b&gt; name;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;void&lt;/b&gt; setName(String name) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.name = name;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;protected&lt;/b&gt; &lt;b&gt;void&lt;/b&gt; display(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.&lt;i&gt;out&lt;/i&gt;.println(&quot;My name is &quot;+ name);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;abstract&lt;/b&gt; &lt;b&gt;double &lt;/b&gt;area();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





















































&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;The source
code of the Square class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;class &lt;/b&gt;Square &lt;b&gt;extends&lt;/b&gt; Shape{&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;private&lt;/b&gt; &lt;b&gt;double&lt;/b&gt; side;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; Square() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;super&lt;/b&gt;(&quot;square&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.side = 0;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; Square(&lt;b&gt;double&lt;/b&gt; side, String name) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;super&lt;/b&gt;(name);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.side = side;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;@Override&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;double&lt;/b&gt; area() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;return&lt;/b&gt; side * side;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;double&lt;/b&gt; getSide() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;return&lt;/b&gt; side;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;void&lt;/b&gt; setSide(&lt;b&gt;double &lt;/b&gt;side) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;this&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;.side = side;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;























































&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;The code of
the circle class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;class &lt;/b&gt;Circle &lt;b&gt;extends&lt;/b&gt; Shape {&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;private&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;double &lt;/b&gt;radius;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; Circle() {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;super&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;(&quot;circle&quot;);&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.radius = 0;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; Circle(&lt;b&gt;double &lt;/b&gt;radius, String name) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;super&lt;/b&gt;(name);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.radius = radius;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;@Override&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;double&lt;/b&gt; area(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;return&lt;/b&gt; 3.14 * radius * radius;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;double&lt;/b&gt; getRadius() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;return&lt;/b&gt; radius;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;}&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;void &lt;/b&gt;setRadius(&lt;b&gt;float&lt;/b&gt; radius) {&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;this&lt;/b&gt;.radius = radius;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





























































&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;The Shape
abstract class defines:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;A common
attribute for all its child classes: the name attribute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;A common
method for all its child classes: the radius method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Then, each
one from the child classes will give its own implementation to the area method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;Also, the
display method is defined once in the parent class and is reused by its child
classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;This is
what we call code reuse.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;This is an
important concept in Object oriented design that is offered by&amp;nbsp;&lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/inheritance-in-java-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;inheritance&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;This is the
code of the main class that puts everything in action:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;class&lt;/b&gt;
TestShapes {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;static&lt;/b&gt; &lt;b&gt;void &lt;/b&gt;main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;Shape sq = &lt;b&gt;new &lt;/b&gt;Square(1.5,&quot;sq&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;System.&lt;i&gt;out&lt;/i&gt;.println(&quot;The area of sq = &quot;+ sq.area());&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;sq.display();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;Shape cir = &lt;b&gt;new&lt;/b&gt; Circle(2.3, &quot;cir&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;System.&lt;i&gt;out&lt;/i&gt;.println(&quot;The area of cir = &quot;+ cir.area());&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;cir.display();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;Square sq1 = &lt;b&gt;new&lt;/b&gt; Square(6.7,&quot;sq1&quot;); &lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;System.&lt;i style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;out&lt;/i&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;.println(&quot;The area of sq1 = &quot;+ sq1.area());&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;sq1.display();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;Shape cir1 = &lt;b&gt;new&lt;/b&gt; Circle(7.5, &quot;cir1&quot;);&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;
&lt;/span&gt;System.&lt;i&gt;out&lt;/i&gt;.println(&quot;The area of cir1 = &quot;+ cir1.area());&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;cir1.display();&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

















































&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 14.0pt; line-height: 115%; mso-ansi-language: EN-US;&quot;&gt;Java abstract class : conclusion&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;This &lt;b&gt;java
abstract class tutorial&lt;/b&gt; arrives at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;We have
explained the&lt;b&gt; abstract class concept with many examples&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;If this
java tutorial was helpful for you, please check our &lt;/span&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;core java tutorial&lt;/span&gt;&lt;/a&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;You can
like our &lt;/span&gt;&lt;a href=&quot;http://www.facebook.com/howtoprograminjava/&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;how to program&lt;/span&gt;&lt;/a&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt; facebook page for more tutorials or
follow our &lt;/span&gt;&lt;a href=&quot;https://plus.google.com/u/0/+Howtoprogramforbeginners&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt;how to program&lt;/span&gt;&lt;/a&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;mso-ansi-language: EN-US;&quot;&gt; Google plus page.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/what-is-java-abstract-class.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNVubs4j5-rULIxW6yI0MravTsb_VTkqVzcAbqpPnoiqEeX6laGfhBISL3g_PnC3boiZfDIDWb7NK0FGlhiSoizF8OS7xGHGvj2ctUi_OB7cZ3x9vZfpadiP3j1a_B7eebRKsLprqcIyM/s72-w400-h245-c/java-abstract-class-tutorial.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-6302715833856677102</guid><pubDate>Sat, 06 Jun 2020 14:24:00 +0000</pubDate><atom:updated>2020-12-05T20:04:43.063+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><category domain="http://www.blogger.com/atom/ns#">extends in java</category><category domain="http://www.blogger.com/atom/ns#">extends keyword in java</category><category domain="http://www.blogger.com/atom/ns#">inheritance in java</category><category domain="http://www.blogger.com/atom/ns#">inheritance in oops</category><category domain="http://www.blogger.com/atom/ns#">java class extends</category><category domain="http://www.blogger.com/atom/ns#">java inheritance example</category><title>inheritance in java tutorial for beginners</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUNwRzfiJkt6iT4Ax_EQlMQpsuSqSyZwqcz_d7PdboTe4AffC_AdS4PGHZvBOV00pSSd3LjxjzBUlEIfAYdZ9EZJev0SyvAW3eTJ-TbAJmTYsLhLJ_9sqoW_cCzkUiIeEHXQWdQehd6YI/s522/Inheritance+in+JAVA+Tutorial+What+is+inheritance+in+java.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;iheritance in java tutorial for beginners&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUNwRzfiJkt6iT4Ax_EQlMQpsuSqSyZwqcz_d7PdboTe4AffC_AdS4PGHZvBOV00pSSd3LjxjzBUlEIfAYdZ9EZJev0SyvAW3eTJ-TbAJmTYsLhLJ_9sqoW_cCzkUiIeEHXQWdQehd6YI/w400-h245/Inheritance+in+JAVA+Tutorial+What+is+inheritance+in+java.jpg&quot; title=&quot;iheritance in java tutorial for beginners&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in java&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
term inheritance in nature refers us to the inheritance between humans or
between animals.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;In the
object oriented development, we borrowed this concept from the nature to enhance
the quality of our code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;In
fact, through the inheritance, we avoid code duplication and we increase the maintainability
of our applications:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;color: black; line-height: 150%; mso-list: l2 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;We define common behavior once in the parent class and all the
     child classes get this behavior automatically without having to copy/paste
     the code that implements this behavior.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;color: black; line-height: 150%; mso-list: l2 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;This increases the readability and the maintainability of the code:
     &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-left: 53.4pt; mso-list: l0 level1 lfo2; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-font-width: 0%;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
number of code lines is minimal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-left: 53.4pt; mso-list: l0 level1 lfo2; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-font-width: 0%;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;Maintainability:
the bugs are localized in the same class. So we correct the bug once inside one
class and this correction is spread to the child classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
child classes can have, in addition to the behavior defined in the parent
class, their own behavior.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
child classes do what does the parent class and do other things that their parent
can&#39;t do.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;In
fact, this is taken from the nature were animals’s children are better than
their parents.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;Let&#39;s
take the example of gazelle: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;A
gazelle with low speed will be caught by a carnivorous and will not survive.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;A
couple of gazelles with high speed will survive and get children which are
better than their parents in term of speed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;These gazelle’s
children inherit chromosomes from their parents that make them better than
their parents in term of speed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;This
is called natural selection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in java example&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: the extends keyword&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will present a class Doctor that is a child of the class Employee.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The class Employee is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String firstName;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String lastName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;int age;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void introduceYourself(){&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt; &lt;/span&gt;System.out.println(&quot;I am an employee&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The class Employee has three attributes which have the default
visibility (the package visibility).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To learn what is a package and why we use package, please check the &lt;span style=&quot;color: #0070c0;&quot;&gt;package tutorial&lt;/span&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To learn about the access modifiers, please check the &lt;span style=&quot;color: #0070c0;&quot;&gt;access modifiers tutorial&lt;/span&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will deal about the visibility problem when dealing with the
inheritance in a next section.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The class employee is called the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;super
class&lt;/b&gt; or the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;parent class&lt;/b&gt; or the
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;base class&lt;/b&gt; of the Doctor class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The Doctor class is called the child class or the subclass or the
derived class of the Doctor class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The code of the Doctor class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Doctor extends Employee {&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/pre&gt;





&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;extends keyword&lt;/b&gt; says that
the Doctor class inherits from the Employee class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We have defined neither attributes nor methods inside the Doctor class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;But, the Doctor class has the stuff defined in its superclass (the
default visibility allows the inheritance because the two classes are inside
the sandbox package):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;It has the three attributes of the super class
     (firstName, lastName and age)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;It has the introduceYourself() method (a public
     method is inherited)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Here, we are reusing the code defined in the super class (Employee).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in java and the access modifiers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The private attributes and methods defined in the super class &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;are not inherited&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The public and protected attributes and methods defined in the super
class &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;are inherited&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in Java and the super keyword&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;We can
access an attribute or a method of the super class using the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;super keyword&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;We can
do it if the access modifier allows it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;These
examples show some uses of the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;super
keyword&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;super():
calls the default constructor of the parent class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;super(String,
String, int) : calls the constructor of the super class that takes two Strings
and an integer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;super.age
: accesses the age attribute of the parent class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;super.introduceYourself()
: calls the introduceYourself() method of the parent class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in Java and constructors:&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;To
learn what a constructor is, please check the &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-constructor-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;constructor tutorial&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
child classes inherit the default constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;But,
they don’t inherit the overloaded constructors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;In
order to learn about overloading methods inside a class, please check the &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/method-overloading-in-java.html&quot; target=&quot;_blank&quot;&gt;method overloading tutorial&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in Java and the default constructor:
example&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package
sandbox;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public
class Employee {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;String firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;String lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int age;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public Employee() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.out.println(&quot;The
Employee class default constructor is called&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public void introduceYourself(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.out.println(&quot;I
am an employee&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The code of the
Doctor class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package
sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Doctor extends Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Doctor(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;TheDoctor class default constructor is called&quot;);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The main class is
the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package
sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public
class TestInheritance {&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Doctor d = new Doctor();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The output of this
example is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The Employee class default constructor is called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The Doctor class default constructor is called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;This example shows
that the default constructor of the parent class is called automatically
without calling it explicitly in the default constructor of the child class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;This is not true
for an overloaded constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in Java and the overloaded constructors:
example&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;An
overloaded constructor of a super class is not called automatically in the correspondent
overloaded constructor of a child class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h4 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in Java example: an overloaded constructor
of the parent class is not called automatically&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
code of the Employee class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package
&lt;/span&gt;&lt;pre&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;class Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String firstName;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String lastName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;int age;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Employee() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Employee class default constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Employee(String firstName, &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String lastName, int age) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Employee class&#39;s overloaded constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.firstName = &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;firstName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.lastName = &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;lastName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.age = age;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void introduceYourself(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;I &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;am an employee&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;



































&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
code of the Doctor class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Doctor extends Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Doctor(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The Doctor class default constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Doctor(String firstName,
String lastName, int age) {&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The Doctor class&#39;s overloaded constructor is called&quot;);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The main class is
the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestInheritance {&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Doctor d = new Doctor(&quot;Mary&quot;,&quot;James&quot;,32);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The output of this
program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The Employee class default constructor is called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The Doctor class&#39;s overloaded constructor is called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;This example shows
that the default constructor is called automatically (implicitly) in the
default and the overloaded constructors of child classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The overloaded
constructor of the Employee super class isn’t called implicitly in the correspondent
overloaded constructor of the child class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance in Java example: calling an overloaded
constructor of the parent class in the child class&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;We can
call an overloaded constructor of the parent class explicitly in the child
class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;This
can be done using the super keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The
example below shows this:&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package
sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public
class Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String firstName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String lastName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;int age;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Employee() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The Employee class default constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Employee(String firstName, String lastName, int age) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The Employee class&#39;s overloaded constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.firstName = firstName;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.lastName = lastName;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.age = age;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void introduceYourself(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;I am an employee&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





































&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
code of the Doctor class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package
sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public
class Doctor extends Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Doctor(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The Doctor class default constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Doctor(String firstName, String lastName, int age) {&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;super(firstName, lastName, age);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;The Doctor class&#39;s overloaded constructor is called&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#ff0000&quot;&gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;



















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US;&quot;&gt;The code of the main class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;package&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt;&quot;&gt;sandbox;&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestInheritance {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Doctor d = new Doctor(&quot;Mary&quot;,&quot;James&quot;,32);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The
output of the program is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The Employee class&#39;s overloaded constructor is called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;The Doctor class&#39;s overloaded constructor is called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;In the
Doctor class, the overloaded constructor of the super class is called using the
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;super keyword&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;In
this case, the default constructor isn’t called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Inheritance In Java and multiple inheritance&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Java doesn’t allow the multiple inheritances unlike other programming
languages like the C++.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This means that a java class cannot inherit from more than one class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This tutorial whose title is &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;inheritance
in java&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;&lt;/b&gt;arrives at its end. You can also
check the oracle &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;inheritance in java tutorial&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Please don’t forget to subscribe to like our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;How to Program&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Facebook page&lt;/b&gt; or to subscribe to our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;newsletter&lt;/b&gt; to get our latest JAVA
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To check our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt;, please check this link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;See you in the next &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;core java tutorial&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/inheritance-in-java-tutorial-for-beginners.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUNwRzfiJkt6iT4Ax_EQlMQpsuSqSyZwqcz_d7PdboTe4AffC_AdS4PGHZvBOV00pSSd3LjxjzBUlEIfAYdZ9EZJev0SyvAW3eTJ-TbAJmTYsLhLJ_9sqoW_cCzkUiIeEHXQWdQehd6YI/s72-w400-h245-c/Inheritance+in+JAVA+Tutorial+What+is+inheritance+in+java.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-6093989730743841594</guid><pubDate>Sat, 06 Jun 2020 13:36:00 +0000</pubDate><atom:updated>2020-12-05T20:21:16.181+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">basic java questions</category><category domain="http://www.blogger.com/atom/ns#">core java interview questions</category><category domain="http://www.blogger.com/atom/ns#">core java interview questions and answers</category><category domain="http://www.blogger.com/atom/ns#">core java interview questions for experienced</category><category domain="http://www.blogger.com/atom/ns#">interview questions</category><category domain="http://www.blogger.com/atom/ns#">java basic interview questions</category><title>Core java interview questions and answers</title><description>&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;b&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUOoNZ7cE7K33cymlUzZ_OSciMfCKHr_Lzv-ueV0m35OxewqlIhgFJrQVY08qrUTU1kUHpefMKMpjlddQ1e8vSC4iTJ-CCl4CIEw1UmEeFCJ-pWbCwwO6KRGOZEz-EUE4DYCDliJJ3OA/s522/core+java+interview+questions+and+answers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Core java interview questions and answers&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUOoNZ7cE7K33cymlUzZ_OSciMfCKHr_Lzv-ueV0m35OxewqlIhgFJrQVY08qrUTU1kUHpefMKMpjlddQ1e8vSC4iTJ-CCl4CIEw1UmEeFCJ-pWbCwwO6KRGOZEz-EUE4DYCDliJJ3OA/w400-h245/core+java+interview+questions+and+answers.jpg&quot; title=&quot;Core java interview questions and answers&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;Core
java interview questions and answers&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt; asked by
the top recruiters in the world. These &lt;i&gt;core java interview questions and
answers&lt;/i&gt; aim to prepare you to pass any interview that deals with core java.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;Those &lt;i&gt;top 55 Core java
interview questions&lt;/i&gt; are selected over the years by recruiters to test the
knowledge of the candidate in java.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;We have also a &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;core java tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt; that you can check in order
to learn the basics of the java language. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;1)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is JVM?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JVM stands for Java Virtual
Machine. It simulates a real computer and provides the runtime environment for
running java applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;In the first step, the java source
code is converted to a byte code (binary code that can be understood by the JVM
: instruction set of the JVM) by the java compiler (javac).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;This byte code is converted by
the JVM into a machine code (binary). Then, the machine code is run by the
computer that has the JRE installed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;Actually, JVM interprets the
byte code and runs the java program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;It uses the class libraries,
and other files provided in JRE in order to accomplish this task.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;2)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is JRE ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JRE is an acronym of Java
Runtime Environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;Java Runtime Environment is an
executable file that includes JVM, class libraries (util, math,etc), and other files.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JRE doesn’t include any
development tool like compiler, debugger, etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JRE = JVM + Java standard classes
(math, lang, util, etc) + runtime libraries&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JREs are available for
download in Oracle website. There are many versions for each hardware
configuration (32 bits/ 64 bits) or operating system (windows, linux, Mac OS,
etc).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;3)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is JDK ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JDK stands for Java Development
Kit. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;It is an executable or a set
of tools created by &lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #222222; font-family: verdana, sans-serif; font-size: 10.5pt;&quot;&gt;sun Microsystems
&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #222222; font-family: verdana, sans-serif; font-size: 10.5pt;&quot;&gt;that is used for &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;creating java application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;JDK=JRE+&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;http://programmingbulls.com/java-compiler&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Verdana, sans-serif; font-size: 10pt; text-decoration: none;&quot;&gt;java compiler&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt; (javac) + debugger + other
development tools.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;Please feel free to check this
tutorial in order to &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-development-tools-install.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;install java development environment&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;4)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is a JIT compiler?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p style=&quot;background: white; line-height: 14.65pt; margin: 0cm;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;JIT compiler stands for &lt;b&gt;Just In Time Compiler&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;A JIT compiler runs&amp;nbsp;&lt;b&gt;after&lt;/b&gt;&amp;nbsp;the
program has started and compiles the code (usually bytecode or some kind of VM
instructions) on the fly (or just-in-time, as it&#39;s called) into a form that&#39;s
usually faster, typically the host CPU&#39;s native instruction set. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;A JIT has access to dynamic
runtime information whereas a standard compiler doesn&#39;t and can make better
optimizations like inlining functions that are used frequently.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;This is in contrast to a
traditional compiler that compiles&amp;nbsp;&lt;b&gt;all&lt;/b&gt;&amp;nbsp;the code to machine
language&amp;nbsp;&lt;b&gt;before&lt;/b&gt;&amp;nbsp;the program is first run (check this link for
more details &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/95635/what-does-a-just-in-time-jit-compiler-do&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;stackoverflow&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;5)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the extension of a source file in java?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;The extension of a source file
in java is “.java”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;6)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is byte code?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;The byte code is different
from the machine code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;This is a binary code that the
JVM can understand and interpret.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;The byte code is written in
the instruction set of the JVM.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;The JVM is like a real
computer that has a CPU having an instruction set. This instruction set is used
inside the byte code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;7)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the extension of a compiled file in java?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;The extension of a compiled
file in java is “.class”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;8)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is a platform?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A platform can be software (Operating system, etc) or
a hardware platform (hardware architecture, CPU family, etc).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;9)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Why JAVA is platform independent?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The JVM is platform dependant whereas our java code is
platform independent.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The Java executable file for desktop applications is
an executable Jar (Java Archive).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;This Jar file is an archive (a compressed file that
contains .class files). You can unzip it like any rar or zip archive.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We can break platform independency when we write a
program that looks for specific OS related files or when using JNI (Java Native
Interface).&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;10)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is a
classloader?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The class loader is a piece of software packaged in
the JRE. Its role is to dynamically load Java classes into the JVM.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;JVM must at least include one class loader which is
the&amp;nbsp;primordial (or bootstrap)&amp;nbsp;class loader.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The classes are loaded in java when needed. The first
class loaded is the one that has a static main method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;11)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is classpath?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p style=&quot;background: white; line-height: 14.65pt; margin: 0cm 0cm 12pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;The
Java Virtual Machine must know where to find the project’s compiled classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style=&quot;background: white; line-height: 14.65pt; margin: 0cm 0cm 12pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;It
is not appropriate that the JVM looks through every folder on your machine in
order to find your compiled classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style=&quot;background: white; line-height: 14.65pt; margin: 0cm 0cm 12pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;So,
we have to provide the JVM with the directories to use to look up for our
compiled classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p style=&quot;background: white; line-height: 14.65pt; margin: 0cm 0cm 12pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;This
is done by putting those directories in the classpath.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;So, the classpath contains the paths used by the JVM
(classloader) in order to find our compiled classes or the libraries used.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;12)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What are the
default values of attributes in a class?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;When accessed before their initialization, the
attributes of a class take a default value based on the type of each attribute:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: symbol; font-size: 11.5pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Numeric
types attributes (int, float, double, etc) take zero as a default value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: symbol; font-size: 11.5pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Reference
type attributes take null as a default value.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;13)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What are the
default values of local variables declared inside methods?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Those variables have whatever value when accessed
before their initialization. We can’t predict their values before their
initialization.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;14)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;How many public
classes can be put per source file?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Only one public class per source file is allowed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For more details, please check our &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;java class tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;15)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What are the
allowed visibility modifiers for a class?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The allowed modifiers for a class are nothing or the
public modifier.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;16)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the
default visibility of an attribute or a method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;When declaring an attribute in a class without
specifying its visibility, it has the default visibility. The default
visibility is the package visibility.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;17)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the this
keyword in java?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;This keyword contains a reference to the current
class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;18)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is a
constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A constructor is a method that initializes the
attributes of an object when it is created.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The constructor is called when using the new keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;19)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What are the
characteristics of a constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A constructor is a method inside a java class that
respects those conditions:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: symbol; font-size: 11.5pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Has the same
name as the class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: symbol; font-size: 11.5pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Has no
return type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;20)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is a
default constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The default constructor is the constructor that has no
arguments. This constructor is automatically generated by the compiler if we
don’t write it explicitly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;When overloading constructor, the compiler will not
auto-generate the default constructor for us. So, we should write the default
constructor by ourselves.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;This can cause many problems when using the well known
frameworks like hibernate, spring, etc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;&lt;span&gt;21)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Do child classes inherit the constructor of parent classes?&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;No, the constructor is not inherited. We can call the
constructor of the parent class explicitly using the super keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;22)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Can we overload
a constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Yes, a constructor can be overloaded.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;23)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Can we override
a constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;No, overriding concept is related to inheritance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The constructor is not inherited.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;24)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Can we make a
constructor final?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;No, a constructor cannot be final.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For more details, please check our &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-constructor-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;java constructor tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;25)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What means a
final class?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We cannot make child classes from this class. We
cannot inherit from a final class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;26)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What means a
final method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The method cannot be overridden.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;27)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is blank
final variable?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The variable is constant. We cannot change its value
once it is initialized.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;28)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is blank
final variable?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;This is a variable declared as final and not
initialized when declaring it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;29)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Where a blank
final variable can be initialized?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The blank final variable should be initialized in the
constructor of the class if it is not static.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;If it is static, we should initialize it in a static
block.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;If we don’t respect these rules, we will get an
exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For more details, please check our &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-variables-for-beginners-tutorial.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;java variables for beginners tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;30)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Can we declare
the main method as final?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;31)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is an
abstract class?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;It is a class that has the abstract keyword in its declaration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;This class cannot be instantiated. It is created to be
inherited.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A class that has at least one abstract method is an
abstract class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;32)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is an
abstract method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;It is a method that has no implementation and is
marked with the abstract keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;33)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is method overriding?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Method overriding is used when creating a method that
is provided in the parent class in a child class. This concept is tightly
related to inheritance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;34)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Is it possible
to override static method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;NO, we can’t override static methods because they
belong to the class itself and not to the instance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;35)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Is it possible
to override the overloaded method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Yes, there is no problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For more details, please check our &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/method-overriding-in-java.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;java method overriding tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;36)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is method overloading?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Method overriding is used inside a single class. It is
used when creating, in the same class, many methods that have the same name but
differ by the list of arguments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;37)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;How method
overloading enhances the readability of a program?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Method overloading enhances the readability of a
program because we aren’t forced to create method of different names that make
the same thing.&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;38)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Is it possible
to overload methods by changing the return type?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;No, keeping the same list of parameters and changing
only the return type will cause a compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;39)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Is it possible
to overload the main method ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For more details, please check our &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/method-overloading-in-java.html&quot; target=&quot;_blank&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Georgia, serif; font-size: 11.5pt;&quot;&gt;java method overloading tutorial&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;40)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Do virtual
methods exist in java?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For those who are familiar with C++, virtual methods
are used to make dynamic binding. They are related to the polymorphism concept.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;In JAVA, all the methods are virtuals.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;41)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is
difference between method Overriding and method Overloading ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none;&quot;&gt;
 &lt;tbody&gt;&lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: center;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Method Overloading&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: center;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Method Overriding&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Inside the same class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;In the child classes: related to inheritance&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Different parameters list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Same parameters list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;42)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is inheritance?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A class B inherits from class A. The class B inherits
some attributes and method from the class A under certain conditions (public
and protected members are inherited).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;In this case, class A is called the parent class
(super class) and class B is called the child class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;So, the child class can use the inherited members
without having to copy/paste them in the code of the class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;43)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the
purpose of inheritance in OOP?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The inheritance allows the reuse of the code of the
parent class inside child classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;44)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the
super class of all the classes in java ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The Object class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;45)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the super
keyword in java?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The super keyword is used inside the child class to
call a method present in the parent class explicitly using the dot notation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We can call a constructor present in the parent class
using the super keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;46)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Can we use both
this() and super() in a constructor?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;No, because each one among the two calls needs to be
the first statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;47)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Does JAVA allow
multiple inheritance?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;48)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What replaces
multiple inheritance in java ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The use of interfaces&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;For more details, please check our &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;&lt;font color=&quot;#b51200&quot;&gt;java inheritance tutorial&lt;/font&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;&lt;span&gt;49)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What we can put in an interface?&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We can put inside an interface:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: symbol; font-size: 11.5pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;final variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: symbol; font-size: 11.5pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;abstract
methods: we can omit the abstract keyword&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;50)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is the
difference between abstract classes and interfaces ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none;&quot;&gt;
 &lt;tbody&gt;&lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p align=&quot;center&quot; class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;background: white; line-height: 17.25pt; text-align: center;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Abstract class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p align=&quot;center&quot; class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;background: white; line-height: 17.25pt; text-align: center;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.65pt; margin-bottom: 6pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;abstract classes has abstract methods and
  implemented methods. So, the child class needs only to implement the abstract
  methods to be non abstract.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.65pt; margin-bottom: 6pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;The implementing class must implement all the
  methods of the interface or it will be abstract.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;abstract classes don’t have this restriction.&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.65pt; margin-bottom: 6pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;The interface can only have final data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;Multiple inheritance is not allowed for classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.65pt; margin-bottom: 6pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;An interface can inherit from many interfaces&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;The abstract keyword must be used&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid black; border-left: none; border-right: 1pt solid black; border-top: none; padding: 0cm 5.4pt; width: 230.3pt;&quot; valign=&quot;top&quot; width=&quot;307&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 14.65pt; margin-bottom: 6pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #242729; font-family: arial, sans-serif; font-size: 11.5pt;&quot;&gt;The abstract keyword is not used even when
  declaring methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;h2 style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;51)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is static variable?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A static variable belongs to the class itself whereas
instance variable belongs to an instance created from this class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The static variable is shared between all the
instances of a class. It is accessed using the class name and the dot notation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Example: ClassName.staticVariableName&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;52)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is static method?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;A static method belongs to the class itself whereas
instance method belongs to an instance created from this class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;The static method can be called without creating an
instance of the class. It is accessed using the class name and the dot
notation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;Example: ClassName.staticMethodName(params)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We can’t use not static attributes inside a static
method and vice versa.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;53)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;Why main method
is static?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We don’t need to create an object from the principal
class in order to call the main method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;54)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is static
block?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;It is a bloc of code (instructions present between
curl braces) marked with the static keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;It is used in a class to initialize static attributes
in the class loading phase.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraph&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;&lt;span&gt;55)&lt;span style=&quot;font: 7pt &amp;quot;times new roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #610b4b; font-family: helvetica, sans-serif; font-size: 13.5pt;&quot;&gt;What is composition?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: georgia, serif; font-size: 11.5pt;&quot;&gt;We have composition when we use an attribute of type ClassB
inside a classA.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;Now, you finished the top 55 &lt;b&gt;Core
java interview questions and answers&lt;/b&gt; and you are ready for the interview.
We hope that you succeed in the interview and to get hired for your dream job.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;If you have some core &lt;i&gt;java
interview questions&lt;/i&gt; that you need to answer. Please feel free to put it as
a comment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;We also advice you to check
our core java tutorial to master the java language. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 17.25pt; text-align: justify;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt;You can get our latest
interview questions by liking our &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;a href=&quot;http://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;how to program&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: verdana, sans-serif; font-size: 10pt;&quot;&gt; Facebook page or subscribing
our mailing list.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/core-java-interview-questions-and-answers.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUOoNZ7cE7K33cymlUzZ_OSciMfCKHr_Lzv-ueV0m35OxewqlIhgFJrQVY08qrUTU1kUHpefMKMpjlddQ1e8vSC4iTJ-CCl4CIEw1UmEeFCJ-pWbCwwO6KRGOZEz-EUE4DYCDliJJ3OA/s72-w400-h245-c/core+java+interview+questions+and+answers.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-1337526468483792180</guid><pubDate>Sat, 06 Jun 2020 13:23:00 +0000</pubDate><atom:updated>2020-06-11T16:12:08.892+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><title>method overriding in java</title><description>&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSUD1HxRnjltlDMs6oCNUdAFocftjPsHsJUvQrs8S6uT1VuUGoN4esw2vdCLV4_9ag1Te-h6zP_FfqJNlf63HO9Ukq2dZzTuoMg-ExDkQLiT-kGZNy1ABxwCkkLhjwvgpWoPUs3qeQJWY/s522/Method+overriding+in+JAVA+Tutorial.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSUD1HxRnjltlDMs6oCNUdAFocftjPsHsJUvQrs8S6uT1VuUGoN4esw2vdCLV4_9ag1Te-h6zP_FfqJNlf63HO9Ukq2dZzTuoMg-ExDkQLiT-kGZNy1ABxwCkkLhjwvgpWoPUs3qeQJWY/s320/Method+overriding+in+JAVA+Tutorial.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/b&gt;&lt;/h2&gt;&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Method overriding
in java&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: introduction&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Method overriding is used when we want to define a method present in the
parent class inside a subclass.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The two methods must have the same name and the same list of arguments:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l3 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Same order of arguments&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l3 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Same types of arguments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l3 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The return type should be assignment compatible
     (identical if it is a primitive type and subclass in the case of reference
     type) with the return type defined in the parent method. It can vary in
     the overloaded methods (not a good design choice).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The parent class contains generally a common behavior between its child
classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Sometimes, the child class needs to change the behavior of the parent
class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This is where it comes the concept of method overriding. This concept
allows changing the behavior of a method present in the parent class while
keeping the name of the method defined in that parent class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Method overriding
in java&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;
example&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will show the code of the super class which the Employee class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void introduceYourself(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;I am an employee&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The code of the child class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Doctor extends Employee {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void introduceYourself(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&lt;/span&gt;System.out.println(&quot;I am a doctor&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The code of the main class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;package sandbox;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestInheritance {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Doctor d = new Doctor();&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; margin-bottom: 0.0001pt; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;d.introduceYourself();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The output of this program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;I am a doctor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We notice that we have overridden the
introduceYourSelf() method of the super class (Employee) in the child class
(Doctor).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The method defined in the child class hides the correspondent
method in the super class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;If we don’t override the method introduceYourSelf() in
the child class, then the introduceYourSelf() method of the parent class will
be called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The method to call in the context of method overriding
is determined at runtime. This is called the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;dynamic binding&lt;/b&gt; in opposition to the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;static binding&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In fact, in the context of the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;static binding&lt;/b&gt;, the method to call is determined at compile time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The dynamic binding is related to the polymorphism. To
know more about the polymorphism, please check the &lt;span style=&quot;color: #0070c0;&quot;&gt;java
polymorphism tutorial&lt;/span&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;method
overriding in JAVA&lt;/u&gt;&lt;/b&gt; is a concept tightly related to inheritance unlike
the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/method-overloading-in-java.html&quot; target=&quot;_blank&quot;&gt;method overloading in JAVA&lt;/a&gt;&lt;/u&gt;&lt;/b&gt;.&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Method overriding
in java rules&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;



&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;-static methods of the parent class cannot be overridden &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;-The methods present in the parent class and that can’t be accessed by
the child class cannot be overridden: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo4;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;private methods cannot be accessed outside the
     class where they are defined&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo4;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;final methods cannot be inherited&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;-We can’t decrease the visibility of the method of the parent class
inside the child class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l0 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;If the method of the parent class is public, then
     we can’t put any access modifier other than public in the child class’s
     method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;If the method of the parent class is protected,
     then we can put the protected or the public access modifiers in the child
     class’s method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;- The method present in the child class cannot throw a checked exception
which is not thrown in the parent class’s method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;- The method present in the child class can throw any unchecked
exception.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This tutorial whose title is java &lt;b&gt;method overriding&lt;/b&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;arrives at its end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Please don’t forget to subscribe to like our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;How to Program&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Facebook page&lt;/b&gt; or to subscribe to our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;newsletter&lt;/b&gt; to get our latest JAVA
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To check our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt;, please check this link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;See you in the next &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;core java tutorial&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/method-overriding-in-java.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSUD1HxRnjltlDMs6oCNUdAFocftjPsHsJUvQrs8S6uT1VuUGoN4esw2vdCLV4_9ag1Te-h6zP_FfqJNlf63HO9Ukq2dZzTuoMg-ExDkQLiT-kGZNy1ABxwCkkLhjwvgpWoPUs3qeQJWY/s72-c/Method+overriding+in+JAVA+Tutorial.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-1535849715615752559</guid><pubDate>Sat, 06 Jun 2020 13:08:00 +0000</pubDate><atom:updated>2020-06-11T16:12:18.141+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><title>method overloading in java</title><description>&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtjmotavWf032nu8Apdzk9cBH7rHgDagTqOY_s2Yn5lfA3sX0DtBN5MS7ky4IJWrfy-KzC30ZsEOPxjwJX7U6YQxClZfe_KebyY6B2gnrKTxvxVTzQZroo1L2XZLVSUC6FtLAXtR55ikM/s522/Method+overloading+in+java+Tutorial.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;method overloading in java&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtjmotavWf032nu8Apdzk9cBH7rHgDagTqOY_s2Yn5lfA3sX0DtBN5MS7ky4IJWrfy-KzC30ZsEOPxjwJX7U6YQxClZfe_KebyY6B2gnrKTxvxVTzQZroo1L2XZLVSUC6FtLAXtR55ikM/w400-h245/Method+overloading+in+java+Tutorial.jpg&quot; title=&quot;method overloading in java&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: introduction&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In the structured programming languages, like the C programming
language, we can’t create two methods having the same name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In JAVA, we can create two or more methods having the same name but
respecting some conditions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We speak about method overloading in JAVA inside the same class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Method overloading in JAVA is different from method overriding.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The later concept (method overriding) is tightly related to inheritance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: conditions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We can create two or more methods having the same name in the same
class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;But, we must respect these conditions:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The overloaded methods must have different arguments list:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Different arguments types&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo1;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Different arguments number &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Overloaded methods are considered as a &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;static polymorphism&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: example&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Hello {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void sayHello(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;Hello There&quot;);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void sayHello(String name){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;Hello&quot;+name);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void sayHello(String name , String otherName){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;Hello&quot;+name+&quot; and &quot;+ otherName);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We create a TestHello class the test the Hello class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestHello {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Hello h = new Hello();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt; &lt;/span&gt;h.sayHello();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&lt;/span&gt;h.sayHello(&quot;Jack&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&lt;/span&gt;h.sayHello(&quot;Peter&quot;,&quot;Mary&quot;);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Here the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;overloaded methods&lt;/b&gt;
are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public void sayHello()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public void sayHello(String name){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public void sayHello(String name , String otherName)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We notice that all those &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;overloaded
methods&lt;/b&gt; have the same name (sayHello). But they differ by the arguments
list (the number, type and order of the parameters).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The output of the TestHello class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US;&quot;&gt;Hello There&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm; mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; mso-ansi-language: EN-US;&quot;&gt;Hello Jack&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Hello Peter and Mary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: arguments match&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The overloaded methods have the same name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: arguments exact match&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The executed overloaded method is chose based on the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;exact match&lt;/b&gt; between the passed
arguments and the formal arguments of the method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Examples:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;If we pass nothing to the sayHello method in the call, then the method sayHello()
without arguments is called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;If we pass two strings to the sayHello method in the call, then the
method sayHello(String name, String otherName) is called and so on.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: arguments promotion&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;If
there is no exact match &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;between
the passed arguments and the formal arguments of the overloaded method&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-font-width: 0%;&quot;&gt;, arguments can be promoted to the required type.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;&lt;b&gt;Example&lt;/b&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Arithmetic {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void add(int a) {&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;sum= &quot;+a+a);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void add(long a, long b) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;sum = &quot;+a+b);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The principal class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestArithmetic {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Arithmetic a = new Arithmetic();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;a.add(1,2);&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In the Arithmetic class, the overloaded method is the add method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In the call of the add method in the TestArithmetic class, we passed two
arguments of type int to the add method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We notice, that the class Arithmetic doesn’t contain an add method that
gets two arguments of type int &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l0 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;there is no exact match between the passed
     arguments (1 and 2) and the formal arguments of the add method : there is
     no add(int a, int b) method in the Arithmetic class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;What happened in this case is what we call &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;arguments promotion&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The argument promotion is representing a type as bigger type (wider
range of values).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The order of numeric types based on the range of values that they can
hold is the following: byte &amp;lt; short &amp;lt; char &amp;lt; long &amp;lt; float &amp;lt;
double&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h4 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;: arguments promotion problems&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will present an example that causes an ambiguity problem caused by
arguments promotion.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Arithmetic {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void add(int a) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;sum = &quot;+a+a);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void add(long a, int b) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;sum = &quot;+a+b);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void add(int a, long b) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;sum = &quot;+a+b);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;





















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To put this class in action, we create the following class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestArithmetic {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Arithmetic a = new Arithmetic();&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;a.add(1,2);&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Here, we create two methods in the Arithmetic class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l0 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public void add(long a, int b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l0 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public void add(int a, long b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Then, we made this call in the TestArithmetic class: a.add(1,2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;There no add method that takes two arguments of type int in the
Arithmetic class (there is no exact match).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In this case, the compiler tries to promote the int arguments (1 and 2
values) to match one of the add methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;In this case there is an ambiguity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;which method to call:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l0 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We promote the first argument to long and we keep
     the second int argument as it is to match the method: public void add(long
     a, int b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l3 level1 lfo4;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We promote the second parameter to long and we keep
     the first argument as it is to match the method: public void add(int a, long
     b)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;So, we should avoid these situations when using method overloading in
JAVA.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif;&quot;&gt;Method overloading in java&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt; and the return type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We shouldn’t create overloaded methods that differ only by the return
type :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l3 level1 lfo4;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The methods have the same arguments list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l3 level1 lfo4;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The methods have different return types&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Arithmetic {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public void add(long a, long b) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;sum = &quot;+a+b);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public long add(long a, long b) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;return a+b;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Here, the overloaded methods differ only by the return type (void and
long).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This is incorrect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This tutorial whose title is java &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;method overloading&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;&lt;/b&gt;arrives at its end. You can also
check the oracle &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;java method overriding tutorial&lt;/span&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Please don’t forget to subscribe to like our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;How to Program&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Facebook page&lt;/b&gt; or to subscribe to our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;newsletter&lt;/b&gt; to get our latest JAVA
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To check our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt;, please check this link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;See you in the next &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;core java tutorial&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/method-overloading-in-java.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtjmotavWf032nu8Apdzk9cBH7rHgDagTqOY_s2Yn5lfA3sX0DtBN5MS7ky4IJWrfy-KzC30ZsEOPxjwJX7U6YQxClZfe_KebyY6B2gnrKTxvxVTzQZroo1L2XZLVSUC6FtLAXtR55ikM/s72-w400-h245-c/Method+overloading+in+java+Tutorial.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-3567716225346169691</guid><pubDate>Sat, 06 Jun 2020 12:07:00 +0000</pubDate><atom:updated>2020-06-11T16:12:25.478+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><title> Java constructor tutorial for beginners</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTZNGQC2IhxbOnnD5D_cC6WwrN36K0ql72peTABsfB49wd_tpKWTeIjiQ4kRU4pkZwBE8ALmvEORexT2J5JzLm2LtgPHSiUui_y4NL4W4QmG8FyZEspiBgG9dd65fh8KJxfl2gtsizEsk/s522/JAVA+Constructor+Tutorial+JAVA+Constructor+For+Beginners.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;java constructor tutorial for beginners&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTZNGQC2IhxbOnnD5D_cC6WwrN36K0ql72peTABsfB49wd_tpKWTeIjiQ4kRU4pkZwBE8ALmvEORexT2J5JzLm2LtgPHSiUui_y4NL4W4QmG8FyZEspiBgG9dd65fh8KJxfl2gtsizEsk/w400-h245/JAVA+Constructor+Tutorial+JAVA+Constructor+For+Beginners.jpg&quot; title=&quot;java constructor tutorial for beginners&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA constructor tutorial: JAVA constructor
introduction&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;As we said in the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-objects-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;JAVA Object Tutorial&lt;/a&gt;&lt;/b&gt;, the constructor is a
special method defined in a JAVA class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The main reason of creating this method is to initialize the attributes
of an object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This method is called when creating new objects to initialize their
attributes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;It is called constructor because it is called when constructing objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;There are rules that should be respected when creating a java
constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will mention those rules in the next section.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA constructor tutorial: JAVA constructor characteristics&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;A JAVA constructor must respect these rules:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-left: 39.4pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;JAVA
constructor must have the same name of the class including capital letters&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-left: 39.4pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;JAVA
constructor doesn’t have a return type (even void is not permitted)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; margin-left: 39.4pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;·&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;JAVA
constructor is used mainly to assign values to the attributes of an object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The constructor gives an initial state to an object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Then, when the program runs, this state will change.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;There are other characteristics of java constructors that are related to
concepts that we haven’t dealt with yet (inheritance,…).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will deal with these concepts when we will deal with those concepts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA constructor tutorial: JAVA constructor types&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We can define many constructors in a JAVA class by overloading
constructors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Check the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;java method overloading
tutorial&lt;/b&gt; to know more about this subject.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;But, in a class we have only one default constructor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;A Java class contains:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Only one default constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l1 level1 lfo2;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Zero or many overloaded constructors&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The default constructor is the constructor which doesn’t have any
parameter.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA constructor tutorial: JAVA default constructor
example&lt;/span&gt;&lt;/h3&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Vehicle {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String color;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;int speed;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Vehicle() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.color = &quot;Black&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.speed = 220;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The default constructor in the example above is the method:&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;public Vehicle()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;If we don’t create a default constructor, the JAVA compiler creates an
empty default constructor for us automatically.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;But, if we don’t create a default constructor and we create an
overloaded constructor, then the compiler will not auto-generate a default
constructor for us.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;So, we should create it by ourselves.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA constructor tutorial: JAVA overloaded constructors
example&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We can add other overloaded constructors as well to the Vehicle class:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class Vehicle {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;String color;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;int speed;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Vehicle() {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.color = &quot;Black&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.speed = 220;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Vehicle(String color, int speed) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.color = color;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.speed = speed;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Vehicle(int speed) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.color = &quot;White&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.speed = speed;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public Vehicle(String color) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.color = color;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;this.speed = 300;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;







































&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The JAVA constructor example above contains in addition to the default
constructor three overloaded constructors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The overloaded constructors are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public Vehicle(String color, int speed) : allows
     to initialize all the attributes of an object of type Vehicle using custom
     values&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public Vehicle(int speed) : allows to initialize
     the speed attribute of a vehicle object and gives a default value
     (“white”) to the color attribute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%; mso-list: l2 level1 lfo3;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;public Vehicle(String color) : allows to
     initialize the color attribute of a vehicle object and gives a default
     value (300) to the speed attribute&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA constructor tutorial: Creating objects using JAVA
constructors&lt;/span&gt;&lt;/h3&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;JAVA calls the appropriate constructor when we use the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;new&lt;/b&gt; operator to create objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The appropriate constructor to call is chosen based on its argument
list.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;We will present a java constructor example that uses the default
constructor of the Vehicle class to create an object:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestVehicle {&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Vehicle v = new Vehicle();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;speed = &quot;+v.speed);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;color = &quot;+v.color);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;













&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The output of this program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;speed = 220&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;color = Black&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The java constructor example below uses the constructor that initializes
all the attributes of an object of type Vehicle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestVehicle {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Vehicle v = new Vehicle(&quot;Gray&quot;, 120);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;speed = &quot;+v.speed);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;color = &quot;+v.color);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;













&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The output of this program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;speed = 120&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;color = Gray&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The final java constructor example uses the constructor that allows to
initialize the speed of a vehicle and gives a default value to the color
attribute.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public class TestVehicle {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;public static void main(String[] args) {&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Vehicle v = new Vehicle(320);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;speed = &quot;+v.speed);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(&quot;color = &quot;+v.color);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;













&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;The output of this program is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;speed = 320&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;color = White&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;This &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;java
constructor tutorial&lt;/b&gt; &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;for beginners&lt;/b&gt; arrives at its end. You can also
check the oracle&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 16px;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-objects-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java objects tutorial&lt;/a&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;, serif; font-size: 16px;&quot;&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;Please don’t forget to subscribe to like our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;How to Program&lt;/a&gt;&lt;/b&gt;&amp;nbsp;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Facebook page&lt;/b&gt; or to subscribe to our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;newsletter&lt;/b&gt; to get our latest JAVA
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;To check our &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt;, please check this link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,serif; font-size: 12.0pt; line-height: 150%; mso-ansi-language: EN-US;&quot;&gt;See you in the next &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;core java tutorial&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/java-constructor-tutorial-for-beginners.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTZNGQC2IhxbOnnD5D_cC6WwrN36K0ql72peTABsfB49wd_tpKWTeIjiQ4kRU4pkZwBE8ALmvEORexT2J5JzLm2LtgPHSiUui_y4NL4W4QmG8FyZEspiBgG9dd65fh8KJxfl2gtsizEsk/s72-w400-h245-c/JAVA+Constructor+Tutorial+JAVA+Constructor+For+Beginners.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7676061512291121409.post-9176798259128233587</guid><pubDate>Sat, 06 Jun 2020 11:46:00 +0000</pubDate><atom:updated>2020-06-11T16:12:35.992+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Core java tutorial</category><title>Java objects tutorial for beginners</title><description>&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiFZhMsXLuTpMD5GjFcax8xszyX-BwyowOrAxt7GdXO6vjMlMrDM7Z0219PlI-OLUpoaVCmVA1jNBGtRo5l3TdmoNdT5XLERdVCRTNziWjnBaMEX_y51CZFPtiSwwoEv7TmF2NzZeOTak/s522/JAVA+Objects+For+Beginners+JAVA+Objects+Tutorial.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;java objects tutorial for beginners&quot; border=&quot;0&quot; data-original-height=&quot;320&quot; data-original-width=&quot;522&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiFZhMsXLuTpMD5GjFcax8xszyX-BwyowOrAxt7GdXO6vjMlMrDM7Z0219PlI-OLUpoaVCmVA1jNBGtRo5l3TdmoNdT5XLERdVCRTNziWjnBaMEX_y51CZFPtiSwwoEv7TmF2NzZeOTak/w400-h245/JAVA+Objects+For+Beginners+JAVA+Objects+Tutorial.jpg&quot; title=&quot;java objects tutorial for beginners&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA objects tutorial for beginners: JAVA objects
introduction&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;As we said in the &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-class-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;JAVA class Tutorial&lt;/a&gt;&lt;/b&gt;, a class is a blueprint
used to create identical JAVA objects that respect the blueprint.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;This means that the JAVA objects created have all the attributes,
methods and inner classes defined in the class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The object contains two main elements:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Attributes: represent the state of an object. Each object has its own
values for each attribute of a class. Those values represent the state of an
object. The state of an object may or may not change during the execution of a
JAVA Program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Methods: represent the behavior of an object (what an object can do).
Those methods may be used to change the state of an object, to manage another
object of another type, to do some computation and return a useful result, etc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;All the objects created from a class have the same methods but their
states are different.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA objects tutorial for beginners:&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt; JAVA
objects creation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA objects are created using the new operator.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;When the new operator is called, a special method called constructor is
called.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;We will deal with constructors in depth in a separate tutorial.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA objects may be created in any JAVA method including the principal method:
public static void main (String [] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The class definition is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;class MyFirstClass {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;//attribute declaration&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;int attributeName1;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;//methods declarations&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;//The default constructor&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;MyFirstClass(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;attributeName1 = 5;&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;void display(){&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(“attributeName1 = ”+ attributeName1);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;} &lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;























&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;We create a new object whose class is MyFirstClass using this single
line of code:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;MyFirstClass mfo = new MyFirstClass();&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Here, we create an object of type MyFirstClass and we put its reference
in the mfo variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;mfo is called a reference type variable because it contains a reference
to the newly created object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;A possible implementation of JAVA reference may be a pointer. But, JAVA
itself doesn’t contain the concept of pointers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The purpose of creating a class is to use it to create objects from that
class. But, there is an exception (abstract classes) that we will deal with it
later.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The MyFirstClass class contains a default constructor: MyFirstClass()&lt;font color=&quot;#ff0000&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;A constructor is a special method that:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Has the same name of the class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
 &lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Doesn’t have a return type (not even void)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;To know more about constructors, check the &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/2020/06/java-constructor-tutorial-for-beginners.html&quot; target=&quot;_blank&quot;&gt;java constructor tutorial&lt;/a&gt;&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;To test the creation of the object above, we should put for example the
object creation line in the main method:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;class &lt;/b&gt;&lt;u&gt;TestObjectCreation&lt;/u&gt; {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;static&lt;/b&gt; &lt;b&gt;void&lt;/b&gt;
main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;&lt;u&gt;MyFirstClass&lt;/u&gt; mfo = &lt;b&gt;new &lt;/b&gt;&lt;u&gt;MyFirstClass&lt;/u&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;











&lt;h2 style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;JAVA objects tutorial for beginners:&lt;/span&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt; calling
methods on JAVA objects and accessing attributes &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;We call a method on java objects using the dot notation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt; line-height: 150%;&quot;&gt;mfo.display();&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;We access the values of the attributes of an object using the dot
notation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;An example of a write access is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;mfo. attributeName1 = 8;&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;or we can display it using this line (read access):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(“displaying the value of attributeName1: ”+ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt; line-height: 150%;&quot;&gt;mfo.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;attributeName1);&lt;/span&gt;&lt;/pre&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;We should put the MyFirstClass and TestObjectCreation classes in the
same package (default package for example) for an access problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;We will explain this when we deal with access modifiers and packages.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The final version of the TestObjectCreation class is the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt; &lt;b&gt;class &lt;/b&gt;&lt;u&gt;TestObjectCreation&lt;/u&gt; {&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;line-height: 150%; text-align: left;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;&lt;b&gt;public&lt;/b&gt; &lt;b&gt;static&lt;/b&gt; &lt;b&gt;void &lt;/b&gt;main(String[] args) {&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;&lt;u&gt;MyFirstClass&lt;/u&gt; mfo = &lt;b&gt;new &lt;/b&gt;&lt;u&gt;MyFirstClass&lt;/u&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;mfo.display();&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;System.out.println(“displaying the value of attributeName1: ”+ &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt; line-height: 150%;&quot;&gt;mfo.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;attributeName1);&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: consolas; font-size: 10pt; line-height: 150%;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;















&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;The output got when running the TestObjectCreation class is the
following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;attributeName1 = 5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;displaying the value of
attributeName1 : 5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;This &lt;b&gt;java
objects tutorial for beginners&lt;/b&gt; arrives at its end. You can also
check the oracle java objects tutorial.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;Please don’t forget to subscribe to like our &lt;a href=&quot;https://www.facebook.com/howtoprograminjava&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;How to Program&lt;/b&gt;&amp;nbsp;&lt;/a&gt;&lt;b&gt;Facebook page&lt;/b&gt; or to subscribe to our &lt;b&gt;newsletter&lt;/b&gt; to get our latest JAVA
tutorials.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;To check our &lt;b&gt;&lt;a href=&quot;https://javasneo.blogspot.com/p/core-java-tutorial-java-core-tutorial.html&quot; target=&quot;_blank&quot;&gt;core java tutorial&lt;/a&gt;&lt;/b&gt;, please check this link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 150%;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;times new roman&amp;quot;, serif; font-size: 12pt; line-height: 150%;&quot;&gt;See you in the next &lt;b&gt;core java tutorial&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;</description><link>https://javasneo.blogspot.com/2020/06/java-objects-tutorial-for-beginners.html</link><author>noreply@blogger.com (Abderrahmen Ben Mariem)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiFZhMsXLuTpMD5GjFcax8xszyX-BwyowOrAxt7GdXO6vjMlMrDM7Z0219PlI-OLUpoaVCmVA1jNBGtRo5l3TdmoNdT5XLERdVCRTNziWjnBaMEX_y51CZFPtiSwwoEv7TmF2NzZeOTak/s72-w400-h245-c/JAVA+Objects+For+Beginners+JAVA+Objects+Tutorial.jpg" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>