Java Full Course 2026 | Core Java Tutorial For Beginners | Java Programming Course | Simplilearn

Simplilearn · Beginner ·🔧 Backend Engineering ·9mo ago
🔥Full Stack Java Developer Program (Discount Code - YTBE15) - https://www.simplilearn.com/java-full-stack-developer-certification?utm_campaign=CfXlQ0DNsxg&utm_medium=Lives&utm_source=Youtube 🔥Full Stack Developer - MERN Stack Program (Discount Code - YTBE15) - https://www.simplilearn.com/full-stack-developer-course-mern-certification-training?utm_campaign=CfXlQ0DNsxg&utm_medium=Lives&utm_source=Youtube 🔥Full Stack Java Developer Program (Discount Code - YTBE15) - https://www.simplilearn.com/java-full-stack-developer-certification?utm_campaign=CfXlQ0DNsxg&utm_medium=Lives&utm_source=Youtube In this Java Full Course 2026 by Simplilearn, we begin with an introduction to Java, exploring its JDK, JRE, JVM, key features, and how to install it on Windows. You’ll then dive into Object-Oriented Programming (OOP) principles like polymorphism, encapsulation, inheritance, and abstraction. The tutorial covers Java basics such as data types, variables, conditional statements, loops, strings, arrays, objects, and classes. We’ll then move to advanced OOP concepts, interfaces, access modifiers, inheritance types, and real-world challenges like the diamond problem. The course also includes pattern program interview questions, database connectivity with MySQL, and an introduction to ORM with Hibernate covering architecture, APIs, and CRUD operations. Finally, we wrap up with Java APIs and frequently asked interview questions to prepare you for Java development careers. Below topics will be explained in this Java tutorial for beginners: 00:00:00 - Introduction to Java Full Course 2026 00:02:28 - Object Oriented Programming in Java - (OOPS Principles in Java) - Polymorphism - Encapsulation - Inheritence - Abstraction 00:07:28 - What is Java? - Java JDK - Java JRE - Java JVM - Java Lambda Expression - Key features of JDK 00:12:31 - How to Install Java on Windows 00:23:41 - What is an Algorithm 00:35:16 - Java Tutorial Loops - While and Do-While Statements in Java - For Loop in J

What You'll Learn

This video teaches Java programming skills using tools like Core Java and Java frameworks

Full Transcript

[Music] Hey there, welcome to simply learn Java course. Java is one of the most in languages by the time you will Java developer choose Java. Well, it's incredibly versatile. It powers everything from mobile apps to massive business system. Plus, Java's platform independence means your code will run smoothly on almost any operating system, which is pretty awesome, right? In this course, we are going to walk you through everything from setting up your coding environment to mastering the core concepts like variables, loop, function, data types, control flow, and object- oriented programming. But wait, there's more. We'll also show you how to integrate AI tools with your Java code, making your development process smarter and faster. And by the end, you will be ready to build real world projects and unlock amazing career opportunities in the booming tech world. So, are you ready? Hurry up and let's get started. Here's a quick information. If you are ready to take your development skills to next level, definitely check out Simply Learn's Microsoft AI powered fullstack developer program. This is designed to make you job ready in just six month interface, NodeJS, Express and more. Leveraging cutting edge AI tools like chargot to supercharge your code. And the best part, you'll earn official certification from Microsoft, which will give your resume a significant boost. This program is designed for people who want to get hands-on experience with coding and understand the full process of developing a modern web app. Plus, you'll have access to Git portfolio, which is perfect for showcasing your work to potential employees. One of the best part of the program is the AI powered job assistance. You'll get help optimizing your resume and LinkedIn profile mock interviews to prepare you for the real thing and even custom job opportunities tailored to your skill set. The demand for AI powered fullstack developers is growing rapidly and companies are looking for people who can combine traditional coding with cuttingedge AI tools. So what are you waiting for? Hurry up and enroll now and you can find the course link below. In today's era, the internet and smartphones have become an integral part of our lives. We use our phones for almost all of our day-to-day tasks. Earlier, we used to shop at malls, queue up in front of banks, and make our travel bookings at travel agencies. But now, we can do all this in the comfort of our homes using smartphones. All of this is possible because of a high-level programming language called Java. Hi guys, welcome to this video that will tell you everything you need to know about the class-based object-oriented programming language Java. Java is an object-oriented programming language that is used in a distributed environment on the internet. It is a highle language that is easy to read and understand. Java is popularly used in console, graphical user interface, web and mobile applications, game development and also to make embedded systems. Apart from these, Java is also used to develop software for devices. It is used not only in computers and mobiles but even in electronic devices like televisions, washing machines, air conditioners and so on. Online forms, banking and shopping are possible because of Java. Java is a computer-based programming language invented by James Gosling and Sun Microsystems in 1991. He had a single moto while creating the language. It was write once run anywhere. This meant that the code would have to be written only once but it could be used anywhere. They named this language oak because of the oak tree outside Gossling's office. Later it was named to green then to Java coffee which was named after the coffee from Indonesia and finally to Java in 1995. There are three additions of Java. Each programmer can learn any of these editions based on the application they want to make. Firstly, we have Java Standard Edition. This edition contains core libraries like Java.lang, Java.util, etc. Secondly, we have Java Enterprise Edition. This edition has APIs like JMS, EJB, JSP, Serlets, etc. And lastly, we have Java Micro Edition, which is used to program Java in cell phones, setup boxes, handhelds, and so on. Java is an object-oriented programming language based on C and C++. However, it is improved and simplified to solve the errors in programming. Java files are converted to bit code format using a compiler and then executed by the Java interpreter. The whole Java code is run on the Java virtual machine which provides a runtime environment. Now, the main concepts in Java are its methods and classes. A method is a block of code that performs a task only when it is called. Consider this example. While watching TV, you use the TV remote to change channels. Each button on the remote performs a different task. Methods in Java are the same. We can have methods to add two numbers or email a person or to convert kilometers to meters. A group of methods make a class. Classes are used to organize code just like how fruits, vegetables, and clinical products are divided into different sections in a supermarket. There are a lot of features in Java. Let's start by looking at them one by one. It has a simple syntax and is very easy to understand and learn. Java language is robust. It eliminates errors that occur in the C and C++ languages. Java also has features like garbage collectors and exception handling. This makes Java very unique. The most popular feature of Java is that it is platform independent. Here compilation happens in byte code and because of this Java can run on any machine. It is a very secure language as it contains no virus. Java has a feature of multi-threading. The feature of multi-threading helps Java do multitasking. Java is a portable language as it can run on any platform and data type sizes are set permanently. So, Java program has a fixed size of the code. The last of all, Java is not as fast as C and C++ but provides higher performance than any other language. Now let's see oops concepts in Java. Java has four concepts. Abstraction, encapsulation, inheritance and polymorphism. In Java, we use objects and classes related to the real world that makes the code easier to make and understand. Abstraction means showing the relevant information that is needed for a task. Encapsulation makes the Java code secure. Data is stored within the classes and it is not easy to access the data. The next feature is inheritance. As the name suggests, the attributes and characteristics of one class can be inherited by another class. Because of this, coders take less time to create the code. Lastly, we have polymorphism, which means using the same method for different tasks. In Java, we can use the same object or variable in two different places where their tasks will differ. It is a fast, reliable and secure programming language that can be used in several websites and applications. It can be used to create applications in a single computer or one that could be distributed across several servers and clients. Java can be used in several scenarios independent of the system that it is used on. So let's look into what Java development kit means. All the Java applications and applets are developed using the Java development kit that is JDK. Now the JDK consists of the Java runtime environment, an interpreter, a compiler, an archiver and a document generator and a few more tools that go into developing a Java program. So now let us have a look at the components of JDK. Java runtime environment JRE primarily is a part of JDK and it can also be termed as Java RTE. The JDK provides the minimal amount of requirements needed to write and compile a Java program. JRE consists of the JVM supporting files and the core classes. The JVM is key to both JDK and the JRE because it is embedded into them. Now, whichever Java program is being run, the JVM is that component of Java that executes a program line by line, thus giving itself the work of an interpreter. We are now in a position to deep dive into the process with which JDK, JRE and JVM work. Let's take a source file and uh save it with the extension Java. This file is compiled and converted into a set of byte code which changes the file extension into class. This is done specifically by the JDK. Now here are the steps that follow. Class loader. It makes sure that all the necessary classes are loaded in the time of the execution of a program. Next byte code verifier that is JVM. The byte code verifier checks the code for errors or irregularities based on access rights on objects or implementation of pointers. It makes sure that the code fulfills the specifications of JVM and does not break the system integrity. And finally interpreter which is JVM. Now while running the program the interpreter loads, checks and runs the code. The implementation is made by the JRE which is the final process. The latest release is JDK9 and it was released in October 2017. But it was in JDK8 that a new feature called the Java lambda expression was introduced that changed the face of Java. Now Java lambda expression is a kind of function which does not need any class to be created. It has been included in the latest version of JDK as it provides a clear concise way to pass functions around. This also replaces earlier bulky anonymous classes and reduces code verbosity that is the length of the code. The syntax for the lambda expression is this argument list, arrow token, body. Now the syntax consists of three components which are argument list. This can be empty or non-mpt. Next the arrow token. Now this is used to link argument to body and finally body. This contains the statement that works with the function. Let us now just see an example of using lambda expression and contrasting it with how code would have been written with anonymous classes. This is the old method and this is the new method with lambda expression. Just have a look at how lambda expression syntax has been used over here. The JDK9 has been released recently and it seems promising with respect to new features and abilities. Here are some of the features. The first one is Java platform module system. This module allows strong encapsulation and declare explicit dependencies. Next, JShell. With the help of JShell, one can directly start writing the code on the console and execute them. Improve Java doc. Java docs have got the search right in the API documentation and as an added bonus the output is also compliant to HTML 5. Next, stream API. The stream API also introduced in Java 8 allows programmers to easily parallelize code for improved concurrency and introduces functional programming abilities to the language. The stream API in conjunction with lambda expressions also comes in handy while iterating, filtering and extracting large amount of data. The release of multi jar makes it possible for quotes to be run on the newer versions of JDK to be released. And welcome to this video where we'll be telling you how you can install Java on your Windows 10 operating system. After we're done with this installation, we'll also show you how you can run a very simple program. So now let's get started. So now let's download Java. Let's go to Google and search for Java download. We'll go to the link we see here, oracle.com. So now here we have the web page. Here we can see Java SE13. So this is version 13. But this isn't the one we are going to download. We're going to download the ETH version, version 8, which is here. Now we're doing this because 8 is one of the more commonly used versions of Java. So let's click this. And here we'll go down. We need to accept the license agreement before we can download it. Now we have two versions here, x86 and x64. Now you can download it depending on what version your operating system is. Now if you do have a Windows 10 operating system, it's highly likely you have a 64-bit version of Windows. Now if you do have a 32-bit version of Windows, you can take the x86. So let's download this. So we've actually already logged in. So we just need to run the installer file. Now let's go to downloads and run the file. So here we have the installer. We'll go to the next step. We'll select this to next. Here we can see where the file is being installed to. We'll go to next. Now if you want to change where you want to install Java, we can press the change option. I'm just going to keep it here. We'll press next and let's commence with installation. And there we go. The installation is now complete. So we don't need any tutorials or API documentation. So we'll just finish off and go to close. Now to see if Java is installed in your system, we can go to command prompt and type the term Java C which refers to the Java compiler. Now as you can see here, this shows a number of different options you can choose from. This also indicates that Java has been successfully installed into your system. Now, if the installation was not successful, you'll see something like Java C is not recognized as an internal or external command, operable program or batch file. But since we've done it successfully, this is what will be shown now. And now we're going to set an environment variable. Now, what exactly is an environment variable? Now, assume you have a file which has a Java extension. This environment variable tells the computer that the Java program needs to be called to run this particular file. So to set the environment variable, we'll need to go to control panel here. Go into system and security, go to system and select advanced system settings. And then this shows up. Now before we go into environment variables, we'll need to go to where the Java file was installed. So let's go to this PC C drive program files and here let's go to Java. So let's go to JDK which is the Java development kit. Let's go to bin here and copy this path. We'll go back to environment variables. Select path here and then press on new. Paste this and okay. Now we'll go back and go to JRE to the path of JRE which is Java runtime environment. We click on this pin again and copy this path. Select this one new and paste that. And there we go. The environment variables are now set. Now let's talk about running that simple program I told you about. Now this is possible with the help of an IDE. N IDE or integrated development environment will give us a platform to code Java. We will be using Eclipse and Intelligj as they are popular and commonly used. That being said, there are several other IDEs that are available in the market. So now let's work with Eclipse. Let's go to Google and search for Eclipse. We'll go to this link. Press download. And then this shows up. Let's click on download. Now we've already downloaded the software. So I'm just going to directly go into the install phase downloads and select Eclipse. With this you can see that there are multiple options for you to choose from. So we're going to select Eclipse IDE for Java developers. Now you have other options like for C and C++, JavaScript, PHP and so on. Let's go to the first one. And here you have the details. You can change them if you want. But I'm just going to go ahead with installation. Now press accept. Now here we remember accepted licenses and press accept. And then here as well we'll remember accepted certificates. Select this one and accept selected. And there you go. The installation is now complete. Let's click on launch now. So here we are setting up a directory as a workspace. Uh I'm not changing it here. So I'm just going to go with launch. Here we have the Eclipse workspace. Now let's close this first. And here we have the package explorer. Now in case this doesn't show up, you can go to window show view and select on package explorer. So now let's go to file new and java project. We need to set up a project name. I'm going to call it my project one. Click next. We'll go to source. So this is where the source code for your program is going to be stored. Then let's finish. And now we'll click on my project one. Go to source. I click new and create a class. We'll claim I'll name the class my class and create it. And here we have it. So now let's write a simple program to multiply two numbers. So now let's write the main function. open bracket. Now we're going to initialize the first number. Now the second one and finally the output and finally the variable that will store the output. Now we'll just give them a simple print statement. Now let's run the code by clicking this option here using my class on Java. And there we have it. Here the product is shown to be 100 indicating that the program is running successfully. Now we're done with Eclipse. Now let's move on to the other ID I was talking about which is IntelliJ. So for that again we'll have to go back to Google so that we can download it. Search for IntelliJ download. Go to this link here. So here you can see that we have two options. The ultimate edition and the community version. Now here the ultimate version has way more options as you can see here. But it's a paid version and only has a free trial. Now the community version is free. So that's what we're going to take. So we'll click on download here. So I've already downloaded the software so I don't need to do it again. So I'm going to go downloads and so here we go. Let's just click on next. Select the location where you want to install it. Press next. Now we will add a 64-bit launcher shortcut on the desktop and create associations. So basically this means that these are the different file extensions that this will support. So Java.groovy. And now let's go to the next step. We'll install now and we'll wait. And there we go. The installation is now complete. Let's not import any settings. We'll accept the privacy policy. We'll set defaults. Now let's create a new project. So here, make sure your project SDK is set to the version of Java you've installed. Make sure this isn't blank. We'll go to next. Here you need to select this option which is the create project from template. And we are now going to create a command line application. Press next. Name the project which I'm going to call my project two. You can change the location if you want. I'm just going to keep it the way it is. And then click on finish. So now we're going to create a simple program through which based on the user's input we can determine whether a number is even or odd. So first we're going to import the package scanner through which we can take the user's input. Next let's go inside here. Let's create the variables reader. Now let's ask for the user's input. Enter a number. We're taking in the value now in the variable num reader dot next int. So this is with which we'll be taking in the value from the user. So we're going to set up a condition to determine whether the number is even or not. So if the number when when divided by two provides the remainder zero, it indicates that it's an even number. We'll show them then Now for the else case, the number is not even or in this case odd. There we go. We're done. So let's run this program. So let's enter 12. The number is even. And there we go. We have a successful output. This indicates that the program is running successfully. So how does algorithm work in real life? So we'll have a use case here on my screen. We have a lady and she is Shrea. Shrea wants to make some tea and for that she's following some steps. So the first step is she'll take a pan and fill it with water and place it on a gas tub. Followed by that, the second step is she'll make sure that the water comes to a nice boil and then she adds some tea leaves and sugar. Followed by step two, we have step three where she'll allow the leaf to be fully expanded and she'll add some milk after that. Next, we have the step four where she will wait for the tea to come for a good decent boil. Next, we have step five where she'll turn off the gas and she'll take the pan off from the stub and the tea is ready to get filtered. And lastly, we have the step six where she's all set with the tea. So, in computer science, an algorithm is a method or set of rules that we must be following to perform some specific calculations or other problems solving operations. As a result, an algorithm is a collection of rules or instructions that govern how a work needs to be conducted step by step to achieve the desired results. To accomplish a task, we first provide some input and then follow a sequence of steps to acquire the required outcome of the input. So that is the fundamental definition of an algorithm and we also had a use case and now we will move ahead and understand the characteristics of algorithms. So basically we have six characteristics of algorithm. So the first one is it should be clear and unambiguous. The second one is that it has to be well defined inputs and the third one is that it has to be having well-defined outputs as well. The fourth property of an algorithm is its feasibility. Followed by that finitness and finally we have language independence. Now we will look into each one of the characteristics in detail. So first we have clear and unambiguous. So this statement is the one which states that the algorithm should be straightforward, simple and easily readable. Each one of its steps should be distinct in every way and lead it to a single conclusion. So the next one is it should be having well-defined inputs. So this means that an algorithm should indicate what output can be expected as well as the input should be properly well- definfined. Now we have the third one. Similarly, we should also have well-defined outputs. So the well- definfined output characteristics of an algorithm means that the algorithm must clearly indicate what output can be expected as well as the output should also be well defined. Followed by the third characteristic we have the fourth characteristic that is the finitness of algorithm. So the finitness of algorithm says that the algorithm must be finite and it must not result in infinite loops or similar situations. So followed by the fourth one we have the fifth characteristic that defines about the feasibility of an algorithm. So feasibility of an algorithm states that the algorithm must be really simple, generic and practical. It must be able to be executed with resources available. Now the last characteristic of the algorithm is being independent of the language. So it means that the algorithm should be defined in such a way that it is completely independent of the language. It must be simple instructions that can be implemented using any programming language. So these were the six major characteristics of algorithm. Now let's move ahead and understand how to write an algorithm. Writing an algorithm does not have any hard and fast rules. Next, algorithms are never created to support a specific programming language. As we all know, algorithms should be capable enough to support the conditional statements such as if, if, else, switch, etc. An algorithm should be capable enough to execute some of the conditional statements such as if, if, else, switch, etc. And also, it must be capable to execute the iterative statements such as for loop, while loop, dowhile loop, etc. We usually create algorithms in a step-by-step manner. However, this isn't always the case. After the problem domain has been well defined, algorithm writing is a procedure that is carried out. We build an algorithm to find a solution to a problem. A problem can be resolved in a variety of ways. Let's look at an example of how to write an algorithm. Consider the following scenario. We need to create an algorithm to determine the largest number among the three given numbers x, y, and z. As a result, the initial solution to the problem can be written in this manner. So, we begin with reading all the three numbers. And in the second step we will have a condition that says if x is greater than y we will proceed to step four. Else we will proceed to step five. Next in step four we establish a condition that if x is greater than zed then x is the largest of the three numbers. Otherwise zed is the largest. If y is greater than zed zed will be the greatest number. Otherwise y will be the largest number amongst all the three in step five. and the procedure will be terminated. Let's have a look at what the next solution has to offer. In this algorithm, we begin by reading all the three variables, then compare all the three numbers in the third step to determine the largest number, which is if x is greater than y, then there is another if else statement that states that if x is greater than y, then x is largest otherwise zed is the largest. Then there's if else statement which says that if y is greater than zed then y is greater otherwise zed is the greatest of the three numbers. So this is how we have multiple solutions to the same problem. So after discussing these solutions we will move ahead and understand algorithm analysis. The algorithm may be studied in two levels. First before it is made and then after it is created. The two analysis of an algorithm are as follows. The first one is priority analysis and the second one is the post analysis. So first we will talk about the priority analysis. Priority analysis refers to the theoretical analysis of an algorithm performed before its implementation. Before implementing the algorithm, other parameters such as processor speed might be considered which does not affect the implementation component. Next we will talk about post analysis. A practical analysis of an algorithm is called as posterior analysis and it utilizes any computer language to build the algorithm. The purpose of this analysis is to determine how much time and space the algorithm takes to operate. Now after being understood the algorithm analysis, we will be able to comprehend the algorithm complexity. Two methods can be used to assess the algorithm complexity. The first one is time complexity which states that the amount of time required to finish an algorithm's execution is known as its time complexity. Followed by time complexity. The other one is the space complexity which is calculated by the quantity of space required to solve a problem and produce an output of space complexity of an algorithm. Let's take a closer look at these complexities. Now we will begin with time complexity of an algorithm. The big O notation is used to express an algorithm's time complexity. The asytomatic notation is used to depict temporal complexity of big O notation. The time complexity is mainly determined by counting the number of steps required to complete the task. Let's take a look at an example to understand this time complexity in a much better way. If we want to find out a multiplication of n numbers, we can do it by executing a loop from 1 to n. Then calculating multiplication when the loop ends. Then multiplication holds the n numbers multiplication. And last we return the calculated multiplication. The loop statement's time complexity will be at least n and when the number of n increases the time complexity will also increase while the code's complexity that is returns multiplication will remain constant because its value is unaffected by the value of n and it will obtain the result in every single step. Next we will discuss about space complexity which is expressed with big O notation just as time complexity. These four items are stored in space complexity. It initially saves program instructions then stores constant values then stores variable values and finally it keeps track of function cells jumping statements and so on. The sum of auxiliary space and input size is used to calculate space complexity. The extra space or temporary space used by an algorithm is referred to an auxilary space. After learning about algorithm complexity, we will look at some of the algorithms pros and cons. So let's start with the advantages of algorithms. Firstly, algorithms are easy to understand. Next, algorithms are step-by-step representation of a solution. And lastly, the problem is broken down into smaller bits or steps in an algorithm making it easier for the programmer. Now, an algorithm also have various drawbacks. One of which being it takes long time to write hence it is time consuming. Second con of the algorithm is algorithms make it harder to demonstrate branching and looping statements. So followed by the advantages and disadvantages of algorithms, we now enter into the final segment where we discuss the differences between algorithms and programming. So the first difference is that an algorithm is a type of programming. On the other hand, a program is more directly associated with a computer performing one or more task. But an algorithm is more of a notation, a technique for solving a problem. Now let us discuss the second difference. An algorithm can be decoded or run by a human whereas the program is only run or decoded by a set of compilers of the computer. Now the third difference basically an algorithm is a design of the solution to the problem. Here we can only analyze the solution but we can never run it. But whereas on the other hand programming is completely a different ball game. Here you can directly implement a certain phase or an entire program and test the programs and get an output. So the fourth and the last difference between an algorithm and programming is an algorithm is written using natural human vocabulary whereas programs are written using any programming language such as C, C++, Java, Python etc. Why do we need loop statements? So generally whenever you are dealing with some data structures in Java which can store multiple elements for example we saw array which can store multiple elements. String is also basically technically a character array which is storing multiple characters. So whenever you have these kind of data structures where you have multiple elements being stored in the same uh then in that case you would like to have a way to iterate or access all of the elements in a seamless fashion. One of the ways is to access them individually one by one but that's too much of work that's too much of code. There has to be a simpler way of accessing all the elements one by one if I want to and that's where the majority of the use cases for using loops coming to picture. Now Java provides multiple constructs to write loops in Java. There is a while loop, there is a dowhile loop, there is a for loop, there is also an enhanced for loop. And in the previous versions of Java, a use case of iterator was also very popular. So there are multiple ways in which you can actually iterate over a collection and access all the elements of the collection one by one and you can use it to multiple useful cases. For example, if you have a huge array of employee salary and you want to give bonus to each of the employees and add the bonus to the salary then you need to do this addition for all the employees. It would be nice to have to return a while loop and the while loop can automatically access all the employee salary one by one and keep adding the bonus to the salary. This would be an easier way to do this rather than individually updating each employee salary. And the first loop statement we are going to understand is a while loop. So the syntax of while loop is very straightforward. You write the while keyword. You enter the actual condition which will be evaluating to a boolean true or false. So you write the expression which will be a boolean expression exactly similar to the conditions which you used to write in your if statements. So you write your condition which will evaluate to either true or false and then you write your statement and these statements will keep executing till the time this particular expression evaluates to true. So generally the way it works is that it will enter the while block. It will evaluate the expression. If the expression becomes true then the statements inside this particular while block will be executed and after the execution of the statement it will again go back again evaluate the expression. We call them steps basically. So it will go to the next step again evaluate the expression. If this again if this still holds true it will again go inside execute the statement move on to the next step. it will again go to the evaluation. So this this loop will continue to go till the time this condition will hold true. If it still doesn't make sense for you, don't worry. We will have a demo of it to make you understand how to use the while loops. And maybe it's a good idea to switch to the IDE and look at an example of it. So I have already created while demo for it. Here it is. It looks very small and simple but it will get to the point where we can understand how and why we'll be will we be using the while loops. So I've created a while demo class. I've added a public static void main method here which is the entry point. I have declared a variable which is int count equal to 1. So the count value is one right now. And then I'm writing a condition here. I'm saying while count is less than 10 do this. So it will print the current value of count and after that I'm using the post increment unary operator. If you remember we covered this in the previous sessions. What is the meaning of this? It basically will increment the value of count by one. This expression is is equivalent to if I write it in this way. If I write count equal to count + 1. This is exactly the same as this. No difference. So this will have the same impact. Fact I will just remove this line because we already have the count ++ here. So if we try to understand this we are basically incrementing the count and then checking the condition again. So at first time it will be 1 less than 10. Yes, that is true. It will go inside and print the count value the current count value which will be one and then it does count ++. So now the count value becomes two. It will again go back here again check the condition saying is 2 less than 10? Yes, that is true. So the while condition again becomes true. It will again go inside this. Print the current value of count which is two. Then do count ++. So it will again increment the value of count. So the now the count value becomes three. Again go back here at condition and saying is three less than 10. Yes, that is still true. Again come here print the three. Again go here make count as four. Four less than 10 prints four. Again count ++ count becomes five and so on so forth. It will keep doing that till the value becomes 10. So at a step when count++ results in the count value being updated to 10, it will go here and say is 10 less than 10. Now that is not true because 10 is equal to 10 but 10 is not less than 10. So this condition will become false and it will exit of this while loop and it will come here and it will execute if there's if there was anything written after the while loop that will be executed. So that's the idea that you want to do something till a particular condition holds true. Then you can use the while loop define your condition and execute the statements and try to do something which changes the state of this condition. Here I'm changing the count so that every time a new evaluation happens. If I comment this, this will result in an infinite loop because one will always be less than 10. I will not be incrementing the count here and it will keep running forever. it will never stop. It will just keep printing one one every time till your computer program runs out of the memory. So always remember not to end up into an infinite loop. That's probably one of the biggest mistakes any beginner programmer does. So please try to be aware of that particular uh loophole. Not try to run an infinite loop. Always try to write something in the code block which can change the state of the condition. And also make sure that that state condition sometimes sometime should become false. You should also make sure that that always becomes false because if I do this if I do this then this condition will always remain true because it is already one then it will become zero then it will become minus1 -2 -3 so on so forth but that value of count will forever be less than 10 and again you will never be able to exit this loop. Your program will be stuck in this loop till your program runs out of the memory. So always remember to write a a statement or a statement of execution in your in your code block which can change the state of the condition which results in some eventual time when this condition becomes false. This condition has to become false eventually otherwise you will never come out of the loop. Always remember that. So if we run this program now let's observe the output. So we can see here this particular statement is printed for 1 2 3 4 5 6 7 8 9 and that's it. After 9 the moment the count++ resulted into the count value becoming 10. It checked that condition and then it just came out of the loop because 10 is not less than 10 and the condition became false. So always do something inside your code block which results at least of one scenario where this condition becomes false and that is how you can use the while loop. Now you can see this is a pretty generic code and you can write any kind of condition here. Write any code you want to execute here and then do something to change the state of the condition as well in a positive way in a way which results this particular condition to be false at some point of time and then your while loop will run fine. So this is all I wanted to cover in terms of the while loop. Hello guys, let's get started with today's topic which is about how to use dowhile loops. So let's understand when do we need that and how do you actually use that. Let me switch to the Java documentation and if I can find some syntax of it as well. Yep. So as you can see here if I just highlight this portion this is how you actually write a do while statement block. So you write do you start a code block you write some executable statements and then after the code block ends you write a while expression and end it with semicolon. This is the syntax basically it starts with do or a curly braces some executable statements a while block or a while statement basically with an expression ending with a semicolon. Let's understand this with the help of a program to understand the structure better. So for this I have created a sample program here which is called do while demo again having a public static void main method and it has a variable which is count and it is initialized as one. Then I write do I write this code block or the curly braces and then I am just printing the value of count. Then I am incrementing the value of count and then I am writing a condition which says while count is less than 10 and semicolon. If you compare this with the previous demo we ran. If I just put them side by side, we had while condition statement and and the and the state change condition. Here we have do statement condition change statement and then we check the condition at the end. So the idea is that if you have a use case where before you even evaluate the condition you want to print something even before you evaluate the condition if you want to do something in that case you will use the dowhile loop. Even before the while actual while loop starts if you want to execute a statement you will use dowhile loop. For example, if you want to print the initial value of the count even before the condition checks, then you can use dowhile loop. If that is not your use case, you can use the simple while loop which is described here in this program. So coming back to the dow while so I say do and then I'm saying print this particular statement without checking anything. This condition will be executed for the first time without any condition check at all. This will just work as is like a normal Java statement. After that I'm incrementing the value of the count and then I'm checking the condition. So remember when this particular condition is being checked the first increment has already happened but in the while case we did the comparison before even the first increment. The first comparison happened with the original value of count but here the first comparison is happening with the incremented value of the count. Hope you get the difference in a better context now that you will use this when you want to do some write some initialization code before you actually hit the condition. So this condition will be evaluated with two less than 10 and then the value will be printed. Let's print this example and we'll also try to play around with this example a bit more to bring to build our understanding better. If I run this program, there is no difference in output. If you compare this with the previous program we ran for the while. So it prints the count value. So this is coming here. Then it increments the value. Then it checks the condition saying is two less than 10? Yes, that holds true. If that holds true, it will go back to statement number nine. Again print this again do an increment on the count and again check the condition with the updated value of the count which will say three less than 10. Now similarly print the value increment check. This will continue to happen till this particular condition becomes false and once this condition is false it will exit out of this whole do while loop and it will go to the line number 12 and if you have any statement written there you can uh that statement will be executed in this case. So let's try to change some values here and let's see if if if we can make sense of this program if we change the value. Let's say if I put 11 here, what will happen now? Let's run this program. You will say the now you will see that this particular output is displayed which says count is 11. So what happened here? The count was 11. It entered the dowhile block. It went to this particular statement which said count is 11. Then it incremented the value. So the value became 12. And obviously 12 is not less than 10. So it did not print it again. It only printed once. Even if the first time the condition was checked, the first condition execution itself resulted in false, still line number nine got successfully printed. And that's the whole that's the whole idea behind using the do while. What if I change this value to 10? Let's see what happens. And after that, we'll run one more combination to just make it more interesting. This time again count is 10. Line number 10 will be printed as count is 10. Then at line number 10 the count is incremented to 11 and 11 is not less than 10. So in this case the loop ends and it will move out. Now what happens if I do this? If I say less than equal to here. Let's run this program and interpret the output. Now again only one statement is printed because in this case the count is 10. 10 is printed here and we are saying 10 + 1 11. 11 is still not less than equal to 10 and that's why the loop just exits. Let's make it 9 and see what happens. Now you see two values. So count is 9. It enters the dowhile loop. Goes to statement number 9. Prints the current value of count which is 9. Then increments the value to 10. Then at line number 11, this while statement is executed and the condition is checked. Is 10 less than equal to 10? Yes, 10 is not less than but 10 is equal to 10. So this condition will hold true. It will go back here. Print count is 10. Make count 11 again. Check the condition is 11 less than equal to 10. No, it's not. And then the condition will return to false and loop will be exited. So hope this will give you a better understanding. Now since we ran different permutations and combinations of the values and we saw when this will be executed and when this will not be executed but the bottom line is very straightforward that whenever you want to write some pre-processing logic even before checking the very first condition of your loop then in that case you will be using a dowh loop otherwise a normal while loop or a for loop will absolutely work fine. Hello guys, let's get started with today's topic which is about for loops in Java. So, so far we covered about while loops and dowhile loops and we also saw different examples of using different types of data structures like arrays. But one of the core requirements whenever you are working with any kind of collection is to iterate over it. Exactly similar to what I explained in the do while and while lectures that you would often require to iterate over a collection or a data structure and for that one of the most sophisticated and easiest way to do that is using for loops. So let's understand the syntax of for loop first and then we will also look at an example of it in the in the Eclipse IDE. So I have just opened the official Java docs here. So if you see this is basically the syntax of a for loop statement. So let's understand it and let's also try to compare it with a while loop so that we can understand how it compares with the while loop. So if we see the syntax we first see the term initialization then we see the term termination and then we see the term called increment. Now if I try to compare it with a while loop there also you basically did these three things. You first initialized a variable outside the while loop which was called initialization and then you wrote a condition which is your termination condition. You wrote a condition saying let's say while I is greater than 10 or while I is less than 10. So that is the condition which is also the termination statement. The loop will continue to execute till that condition evaluates to false and that's when the loop terminates. That's why we call it as termination. And then the third piece of it is the increment the I++ which we used to do in the while loops. So these three portions together make or constitute any kind of loop in any kind of programming language. And for loop if you see the the kind of code which you use to write in a while loop in multiple lines where you first initialize a variable then you write a condition in the while block and then inside the while block you use to increment the variable all of that can be done in a single line in the for loop and that's why I said it it is the most sophisticated and easiest way to write loops in Java. So you write all of these three things the initialization the condition and the increment or decrement values in a single line and then you start with a curly braces and you write the code which you want to keep executing till the condition evaluates to false. That's the basic syntax of it. So let us try to understand this with the help of an example. So here I have opened a class which is called for demo and this is a class which will demonstrate the usage of a for loop. So again we have a public static void main method which you can see here which is the entry point and then I use the keyword for. I put standard uh braces or the brackets and then I do the initialization. So this part is the initialization part. You initialize the variable. So I just say int i equal to 1 initialization done. You end it with a semicolon so that it is a single statement understood by Java. And then you write this condition which is your evaluation/termination condition. So this condition is basically the the deciding factor of how long your loop should run. It's exactly similar to what you used to write in the while block. If I just show you the example, this is what we used to do. So we did the initialization at line number seven. Then we wrote this termination condition inside the while uh syntax or the construct and then we did the increment here. So we are doing all of these three steps but we are doing it in a single line. So this is the condition and then we write our increment or decrement uh values which are going to change the evaluation condition every time at every step. So we are saying I ++. So technically what I am saying here is that start with i equal to 1 and then check the condition i less than 10. So in the in the first step it will be checking if 1 is less than 10. If the condition holds true go inside the for loop execute the statement at line number seven and then go back to this particular statement. So we do y ++ so i becomes 2. And then you again go back to the condition and again you check if 2 is less than 10. Yes it is. So again you go inside inside the for loop and do whatever is written there. There can be multiple statements here. For now I have just written one system.out.print ln. So that happens and once all the execution is finished inside the block it will again go back to the increment does the increment. So 2 + 1 becomes three. again does the evaluation exe and if the if the condition holds true it will again go inside. So this will continue this condition checking execution and increment will continue till the time this condition holds true. The moment this condition becomes false the control will come out at line number nine. So that's the basic anatomy and control flow. It's very important to understand the control flow of a for loop otherwise you might end up into a program which is forever running and which will just eat up all the memory available in your JVM. So be very sure of what you write in your for loop. Be very sure of especially these two parts the condition and the increment or decrement. So this is very important piece. The initialization happens only once and then this condition evaluates. If the condition holds to true, some code executes, goes back to the changing statement which can be an increment, decrement, whatever, and again compares the updated value with a condition. So this will keep happening. Let's run this code to interpret the output. So I will right click, go to run as Java application. And if I interpret the output here, I can see that it started with count is 1 2 3 4 5 6 7 8 and 9. It stopped at 9. So what happened there? Let's try to evaluate the termination condition. So let's say I has become 9 and 9 is less than 10. So it goes inside and it prints count is 9 which is I. Then it goes here and it says 9 + 1. I ++ means 9 + 1. the current value of i + 1 it becomes 10 and then it again compares the condition. So now 10 is not less than 10. 10 is equal to 10 but it is not less than 10. So the condition becomes false and count is 10 is never printed because this condition has become false. It will jump out. So let's say if I do this if I put an equal to here and if I now execute the same program this time I will see 10 here and because I have said that okay check the condition if 10 is less than equal to 10 that will become true it will print count is 10 then it will increment and the count will become 11 the I will become 11 and then it will check 11 is less than equal to 10 no it is not so condition becomes false and the control comes out of the loop so that's how you should always try to interpret the loops. You can also run some infinite loops. For example, if I say I = 1, I leave it that and I say I minus minus. So what happens? I equal to 1. 1 is less than 10. Yes, it goes here, prints the value and then I decrement the value. I don't increment the value. I decrement the value. So whatever value comes out will always be less than 10. And this loop will run forever. For fun, let's try to run this. And I will I will have to kill this program manually. But just to show you what happens and what you should not do in your in your Java program. So you see it will continuously keep printing the values till the program runs out of memory till it eats up all the available memory. It is it is forever running. It will never stop because the condition will never remain never never evaluate to false. This condition will forever be true. So the loop will run forever. So I'm just going to kill the program. But this is something which you should avoid whenever you are writing Java code. And this happens quite often with beginner programmers. Hello guys and let's get started with enhanced for loops in Java. We generally use the enhanced for loops for scenarios whenever we have to iterate over a collection of items or an array of items. Those are the most popular and common use cases of using enhanced for loop. And this for loop is even simpler. Like I said, it's even simpler than writing a classic for loop. And the syntax is simply like this. You again start with for put the standard brackets and then let's start from the rightmost because then it I will be able to explain it better. You specify the collection in the rightmost side of the bracket. The collection can be an array, it can be a list, it can be a map. So whatever different kind of collections which are available in Java and we are going to cover collections in detail. So don't worry if you don't understand what are lists and what are maps and what are sets. We will go into detail of each of these one by one in the upcoming sessions. But the idea is that you put the collection to the rightmost. Then you put a colon and then you put a representation of the member of this collection. So for example here this numbers is basically an int array. So this int array means that this array can only hold integer numbers. And that's why we write int here because this array is only having integers. Then we put any placeholder variable name. This can be anything. You can even write it as I if you want to. You can write it as anything. Any variable name which you want to write. This is a temporary variable. So now this code is going to execute in a manner that it is going to iterate over this array one by one starting from the first element going till the last element. You don't need to write any initialization code. You don't need to write any termination condition code. And you don't need to write any increment or decrement code also. And how these threes uh how these three values are actually taken care of. Let's understand that as well. So when we talk about the initialization as I have put an array here, a data structure here, the automatic initialization index is going to be the first index. So when we do the iteration when this for loop is going to execute it is automatically going to initialize a temporary variable with the value at the first index which is the index zero. As you know that array is a zero index based structure. Then comes the condition part. So the condition evaluation is going to be again based on the size of the array or the size of the data structure which you're using. It is going to start from the first index which is the index zero and it is going to iterate till the array's last element is reached. So technically start from the index zero and go till the last element. That's your evaluation condition. And then comes the increment part. So at each step after it has successfully accessed the first element automatically the index is going to be updated to pointing to the next element. So if it starts from here once the first step iteration is complete I is automatically going to be incremented to index one and then it will basically this I will be holding two. Then in the next iteration the same I is going to be holding three. Similarly, I will keep holding the new value of the collection item one by one till the collection items last element is reached. So this is the basic promise that you can write a collection variable here and keep iterating over it and this whatever variable you write here will hold the current items value one by one. So in the first step this I is going to hold one. In the second step, this I is going to hold two. In the third step, this I is going to hold three and so on so forth. That's the basic idea. So now let's run this program to see what kind of output do we get. So you can see we basically are able to print all the elements of the array. And that's probably one of the most popular usage as well that if you want to just print all the elements or access all the elements of a array or a collection one by one, then just use an for loop. So you can see at each step it is printing the value of I and the value of I is basically the subsequent elements of the array. That's the whole idea with enhanced for loop. Under the hoods, if you talk about how does it work under the hood, it is actually using the classic for loop construct itself. But for developers, it is making it easier because it knows that if you are iterating over a collection, you will start with the first element and you will go till the last element. So it knows the initialization value, the termination condition and it also knows the increment condition. And that's the reason you will use enhanced for loops in Java for iterating over collections. Hello guys, let's get started with nested for loops in Java. So in front of you, you can see an example which I have prepared for nested for loops. And in this particular example, I have created a two-dimensional array. As you can see on the line number six, I have created an integer array and I have put two square brackets here which are basically symbolizing that this is a two-dimensional array. So this two-dimensional array is going to hold technically a 2D matrix and we are going to use the concept of nested for loops to print this 2D array in a 2D matrix style where you will be able to see the rows and columns clearly. Let's first try to inter uh inter interpret this particular uh 2D array. So we have a curly braces outside and then we have these three inner elements which symbolizes three rows basically. So this is the first row, this is the second row and this is the third row and then each of the rows have three elements each which symbolizes the column values or the item values. So it's basically a 3 into three 2D array which has three rows and three columns. So, so we can say that this is basically a 3 into3 array which has three dimensions on the row side and three dimensions on the column side or just a 3x3 matrix or 3x3 2D array. So as we know that in case of arrays everything starts from zero. So technically if we talk about the indexes it would be the index 0 index one and index two on the row side and similarly index 0 index one and index two on the column side. So that's that's something which you should remember because we are going to use this particular concept when we write the for loop. So let's try to write the for loop. Now if you look at line number eight, we put this keyword called for and then we write the initialization. So we say int i equal to zero. Then we are writing the termination condition and we are saying run this particular loop run this whole loop which ends at line 13 till i is less than three and keep incrementing i at every step. That's what I'm doing in the line number eight. Then inside the for loop I'm writing another for loop which has another different variable called j. It can be anything. You can name it anything you want. And this also starts with zero. And this also has a similar condition which is which says run this particular loop the line 10 basically or this loop which is signified by this curly braces run this particular loop till the time the value of j is less than three and keep incrementing j at every step and at line number 10 print the element of array which has the current value of i and the current value of j. These are basically the positions. These are not the elements. The element would be represented by this hole. But print the element which is at current I and J's position values. That's what this code means. So let's try to do a dry run on this particular code to understand how this is going to work. So at first we have I equal to0. 0 is less than 3 and it goes inside. It initializes J as well with zero and J is 0 is also less than three. So this condition went true. That's why we went to line number nine. And line number nine condition also went to true. So we went to line number 10. Remember that in this particular case at line number 10 the values of i and j are zero and zero respectively. And we are saying print the array of zero and zero. So zero rows zeroth column element should be printed. So this is the zero row because this is the first uh first sublock and this is the first element. So in this case in line number 10 two should get printed. Then it goes here and it increments the j to 1. So 0 + 1 becomes 1. It again checks the condition is 1 less than three. So yes 1 is less than three. It goes here. Remember it did not go up at line number eight. It just came back from line number nine. So when it comes here I is still zero but J has moved from zero to 1. So now we are trying to access the element which is at zero row first column which is going to be seven. So 7 is going to get printed. Similarly on the next iteration J is going to get incremented from 1 to 2 and again the condition will be evaluated. So 2 is less than three. All good. It will again come back to line number 10. And now it will say print the value of zero row third or the second column or the third element. So zeroth row third element which is the 9. So 9 will get printed. Then again J will be incremented and J will become three. 2 + 1 3. And now the condition will be evaluated. Is 3 less than three? No, it is not less than three. The condition becomes false. So it breaks out of the loop. Goes to line number 12. prints an empty line because we are not writing anything here. So it will just print a blank line and now it will go back to line number eight's condition and it will do an increment of I and now I will move from zero to one and now the evaluation will happen. Is one less than three? Yes, 1 is less than three. So it will again go to line number nine. Again initialize J with a fresh zero. The previous J got destroyed the moment you came out of the loop. So this is a new J. So this J again gets initialized to zero. 0 is less than three. It goes here. Remember I was one in this time. So now it will print the value of this 2D array which is sitting at 1 comma 0. Basically second row first element. So second row first element which is three. Again J is going going to get incremented and it will become from 0 to 1. So 1 is less than three. Yes, it will again come here and it will print the value of the array which is sitting at array of 1 comma 1 for a row equal to 1 and column equal to 1 which will be six. Similarly, J will get incremented again. Again 2 is less than 3. Come back here we'll print 1. Then again we'll increment J. J will become three. 3 is less than three. No, it's false. The condition is false. So it jumps out of the loop. Goes to line number 12. prints a blank line again goes back to 8. Line number eight increments I and I now becomes two. 2 is less than three. Yes, it will again go here. Initialize J again with zero. And again does the same thing for the row two and column 012. And again it will come out of the loop. This time again when it will go here the value will become from 2 to 3 and 3 is not less than three. So then it will break out of the outer loop. So the idea is execute the inner loop for every value of the outer loop. Remember this line because that is how you will be applying your knowledge of nested for loops to be used in certain condition. So whenever you have a scenario where you have to iterate over a collection based on a certain value of another collection then you can use nested for loops or you have a scenario where you have to iterate over 2D or 3D arrays. For example, if we were dealing with 3D arrays, then you would have seen three nested for loops here and where it will apply the same logic that iterate over all the collections, all the values of the inner loop on a particular value of the outer loop. Then increment the value of the outer loop and do the same thing again. Iterate over all the values of the inner loop based on a fixed value of the outer loop. So let's run this program and let's see what kind of output do we get. So like I said our our motive our target was to print this in a in a matrix style and you can see that it is printing in a in a sort of a matrix representation. So the first row gets printed here then the second row gets printed here and then the third row gets printed here. If you try to decipher it it will work exactly the same way as I explained. So I equal to0 less than 3 condition becomes true comes here. J equal to 0, J less than 3. C condition becomes true. Comes here, prints the array of 0 comma 0 which is two. Then prints the array of 0a 1 which is 7. 0a 2 which is 9. Then J becomes three. It breaks out of the loop. Goes up here. I becomes from 0 to 1. 1 is less than three. Yes, again comes here. Reinitializes a fresh for loop with a new J setting to zero. And it will it will print the array of 1 0 1 1 2. Then similarly array of 2 0 2 1 2. So that's basically what we are doing. We are iterating we are picking the first row and iterating all elements of it. Picking the second row iterating all all elements over it and so on so forth. You can do this for any n dimensional kind of array or a collection. So now let's download Java. Let's go to Google and search for Java download. We'll go to the link we see here oracle.com. So now here we have the web page. Here we can see Java SE13. So this is version 13, but this isn't the one we are going to download. We're going to download the ETH version, version 8, which is here. Now, we're doing this because 8 is one of the more commonly used versions of Java. So let's click this and here we'll go down. We need to accept the license agreement before we can download it. Now we have two versions here, x86 and x64. Now you can download it depending on what version your operating system is. Now, if you do have a Windows 10 operating system, it's highly likely you have a 64-bit version of Windows. Now, if you do have a 32-bit version of Windows, you can take the x86. So, let's download this. So, we've actually already logged in. So, we just need to run the installer file. Now, let's go to downloads and run the file. So, here we have the installer. We'll go to the next step. We'll select this to next. Here we can see where the file is being installed to. We'll go to next. Now if you want to change where you want to install Java, we can press the change option. I'm just going to keep it here. We'll press next and let's commence with installation. And there we go. The installation is now complete. So we don't need any tutorials or API documentation. So we'll just finish off and go to close. Now to see if Java is installed in your system, we can go to command prompt and type the term Java C which refers to the Java compiler. Now as you can see here, this shows a number of different options you can choose from. This also indicates that Java has been successfully installed in your system. Now if the installation was not successful, you'll see something like Java C is not recognized as an internal or external command, operable program or batch file. But since we've done it successfully, this is what will be shown now. And now we going to set an environment variable. Now what exactly is an environment variable? Now assume you have a file which has a Java extension. This environment variable tells the computer that the Java program needs to be called to run this particular file. So to set the environment variable, we'll need to go to control panel here. Go into system and security. go to system and select advanced system settings and then this shows up. Now before we go into environment variables, we'll need to go to where the Java file was installed. So let's go to this PC C drive program files and here let's go to Java. So let's go to JDK which is the Java development kit. Let's go to bin here and copy this path. We'll go back to environment variables. Select path here and then press on new. Paste this and okay. Now we'll go back and go to JRE to the path of JRE which is Java runtime environment. You click on this pin again and copy this path. Select this one new and paste that. And there we go. The environment variables are now set. Now let's talk about running that simple program I told you about. Now this is possible with the help of an IDE. An IDE or integrated development environment will give us a platform to code Java. We will be using Eclipse and Intelligj as they are popular and commonly used. That being said, there are several other IDEs that are available in the market. So now let's work with Eclipse. Let's go to Google and search for Eclipse. We'll go to this link. Press download and then this shows up. Let's click on download. Now we've already downloaded the software. So I'm just going to directly go into the install phase downloads and select Eclipse. With this you can see that there are multiple options for you to choose from. So we're going to select Eclipse IDE for Java developers. Now you have other options like for C and C++, JavaScript, PHP and so on. Let's go to the first one. And here you have the details. You can change them if you want. But I'm just going to go ahead with installation now. Press accept. Now here we remember accepted licenses and press accept. And then here as well we'll remember accepted certificates. Select this one and accept selected. And there you go. The installation is now complete. Let's click on launch now. So here we are setting up a directory as a workspace. Uh I'm not changing it here. So I'm just going to go with launch. Here we have the Eclipse workspace. Now let's close this first. And here we have the package explorer. Now in case this doesn't show up, you can go to window show view and select on package explorer. So now let's go to file new and Java project. We need to set up a project name. I'm going to call it my project one. Go to next. We'll go to source. So this is where the source code for your program is going to be stored. Then let's finish. And now we'll click on my project one. Go to source. I click new and create a class. We'll claim I'll name the class my class and create it. And here we have it. So now let's write a simple program to multiply two numbers. So now let's write the main function. open bracket. Now we're going to initialize the first number. Now the second one and finally the output and finally the variable that will store the output. Now we'll just give them a simple print statement. Now let's run the code by clicking this option here using my class Java. And there we have it. Here the product is shown to be 100 indicating that the program is running successfully. Now we're done with Eclipse. Now let's move on to the other ID I was talking about which is Intelligj. So for that again we'll have to go back to Google so that we can download it. Search for Intelligj download. Go to this link here. So here you can see that we have two options. The ultimate edition and the community version. Now here the ultimate version has way more options as you can see here. But it's a paid version and only has a free trial. Now the community version is free. So that's what we're going to take. So we'll click on download here. So I've already downloaded the software so I don't need to do it again. So I'm going to go downloads. And so here we go. Let's just click on next. Select the location where you want to install it. Press next. Now we will add a 64-bit launcher shortcut on the desktop and create associations. So basically this means that these are the different file extensions that this will support. So Java.groovy. And now let's go to the next step. We'll install now and we'll wait. And there we go. The installation is now complete. Let's not import any settings. We'll accept the privacy policy. We'll set defaults. Now let's create a new project. So here make sure your project SDK is set to the version of Java you've installed. Make sure this isn't blank. We'll go to next. Here you need to select this option which is the create project from template. And we are now going to create a command line application. Press next. Name the project which I'm going to call my project two. You can change the location if you want. I'm just going to keep it the way it is. And then click on finish. So now we're going to create a simple program through which based on the user's input we can determine whether a number is even or odd. So first we're going to import the package scanner through which we can take the user's input. Next let's go inside here. Let's create the variable reader. Now let's ask for the user's input. Enter the number. We're taking in the value now in the variable num dot next int. So this is with which we'll be taking in the value from the user. So we're going to set up a condition to determine whether the number is even or not. So if the number when when divided by two provides the remainder zero it indicates that it's an even number. We'll show them then. Now for the edge case, the number is not even or in this case odd. There we go. We're done. So let's run this program. So let's enter 12 number is even and there we go. We have a successful output. This indicates that the program is running successfully. Let's begin with the fundamentals. So the first one in the fundamentals is the data types. So every programming language has a data type. So what exactly is a data type? So whatever the input you provide in your program is a data type. For example, if you provide numbers, so in that particular numbers, we have a different variety of numbers. If you are given just 1 2 3 so on without a decimal number, then that particular type of input which is a number will be considered as integer type. If you provide the same number with a decimal point, then that will be considered as float. And if you have the range greater than float, it will be considered as double and so on. So this is how we have multiple data types in every programming language. So the most frequently used data types in Java programming languages are as follows. At first we have the bite. Followed by that we have short, int, long, next float, then double, boolean and finally care. Apart from this we also have few other data types but these are the most frequently used ones for all the basic programmings. So this is made for beginners basically. So you can take a quick screenshot of this particular slide so that you can have a quick overview or reference to all the data types in Java programming language. So I hope you have taken a screenshot of this. Now let's begin with the next concept. So in the next concept we have the keywords and variables. So all the programming languages have variables and keywords. So variables are used to store the values. So for example consider that you wanted to run some arithmetic operation on two different values that is five and 10. So in order to do so you might want to create a variable which stores them. For example you wanted to store the value of 10 in a certain variable a and the five in a certain variable b. So if you apply the arithmetic operation that is a is equals to a + b then the value of a which was previously 10 will be updated to 15. So here you can see the value is varying and also it is storing the result. So this is why the variables are used in a program in order to store a value. And this particular term variable is used because the value can change at any instance of time once after a certain arithmetic or a logical operation is performed on that particular variable. So similarly we have keywords. Unlike variables, keywords have a special meaning. No matter whatever you try, you cannot change the meaning of that keyword. For example, consider main. So you cannot use the term main for normal things because the part or the term main is dedicated for a different purpose. So whenever you try to execute your Java program, the control flow will start executing the program right when it reads the term main. So it has a special meaning. Similarly, you have other keywords such as int. So that is dedicated for integer type of values and float for float type of values that is a decimal values and bite for bite care for character type data string for string. So every keyword or every term with special meaning which is predefined and cannot be changed is called as a keyword. Now let's see the most frequently used keywords in Java programming language. So similar to the previous one we have a table here. So in this particular table we have the most frequently used keywords in Java. So you can see we have boolean, final, bite, native and we have void, switch. So switch is a conditional statement. So we have if if it is also a conditional statement. We will go through this conditional statements as we proceed in our tutorial. And you can also see the protected. So this term which is protected public. So this is basically the access modifier. Even this particular keyword have special meaning. This public this protected keywords provide the information to the compiler or the interpreter about the accessibility of that particular data member or data manipulating method. So if it is protected from your accessibility or is it available for you, it's provided by these keywords. So we will deal with access modifiers in the upcoming part. Don't worry about that. And as you can see we have implements extends. So extends uh this term comes in inheritance. So inheritance is one of the crucial concepts of object- oriented programming. You can also see abstraction. So this we will be dealing in the next upcoming part where we will understand the object- oriented programming concepts. Next we have interface return and so on. You can also see some keywords like through. So throw will come in exception handling. So we will also learn about exception handling in the upcoming part. So these are the most frequently used uh keywords in Java. So now we will move ahead into our next concept. So the next concept is the operators in Java. So to understand operators. Let's go through a table. So on my screen you can see a table which has some arithmetic operators which are most commonly used that is the plus for addition, minus for subtraction. Similarly we have star forward slash double plus double minus. So double plus and double minus say they are increment and decrement operators respectively. As you can see we have a ++ here which means the post increment. So the first value will be read after that the value will be updated. Next we have the pre-increment the value will be incremented first then the updated value will be stored. So that's that's how the increment and decrement operators work. So we have the modulus over here. So to understand the operators that we use in Java in a much better way, let's try to execute a sample program. So on my screen you can see a program which is based on operators. So we are currently on the Eclipse IDE. Don't worry about the ids and Java etc etc. So I will drop a link in the description box below which will explain you in a very detailed way about how to install Java into your local system and how to install Eclipse IDE in your local system and also how to create your first project, how to create your package, how to create a new class, how to write your program and how to run that, how to see the output and a complete overview of the Eclipse IDE, how that works. So everything will be linked in the description box below. You don't have to worry about that. So right now to save time I have created the text document which has all the programs that we will be executing today. So I will also drop a link for that particular file so that you can have complete access to that file so that you can run the programs in your personal PCs or laptops and also understand the programs in a much better way. So now let's begin with the program. So this particular program is basically designed for arithmetic operations. So you can see we have the operators that is the addition, subtraction, multiplication, division, modulus and exit. So basically we will be taking input from mu. So the input will be taken by the user that is we we using scanner class here. So scanner class takes the input from user and that particular input will be compared here. So we using the switch case here. So if you provide the option as one then addition operation will be run. Similarly second for subtraction, third for multiplication, fourth for division, fifth for modulus and sixth to exit. So this is how the u loop or the program works for arithmetic operations. Now let's quickly run this program and see the output. So you can see the program got successfully executed and we have the console asking for the first input. Let's provide some random number. Now let's provide the second number. So there you go. We have our options over here. Now let's choose um division operation. For that we need to provide the number four. So there you go. We have the result over here which is four. Now the loop has started once again. Now it's in the starting stage again. It's asking for numbers. Now let's provide 25 and uh five. Uh now let's choose some operation that is addition. So for that you need to provide one. So we have the result again that is 30. Now let's again choose some number 10 5. So basically that's how the program works. So we have the brief idea how the program is running now. So now let's quickly continue with our next topic. Now to terminate this loop you can provide the option number six. So we have terminated it. So I hope you understood how the program flow is running. So if you did not understand don't worry. I have linked the document in the description box below. You can take the access of that particular document and you can check the program and run in your local system. And also you can make some modifications to it. As you can see we don't have a default case over here. I've just placed the case 1 to six and uh I'm saying the default because you can see that the options are from 1 to six. What if the user provides the number as seven right? So the program might crash over here. So for that purpose you can write in another case that would be the default case. So the default case will check if the number is anything above or out of the range of 1 to six. Then it should be providing you with an output saying a wrong input has been given or check your input or something similar. So that's how you can make some modifications to it. You're free to modify the code as well. Don't worry about that. So now let's quickly begin with our next concept. So in the next concept we have the conditional statements. So what are the conditional statements or the control statements? So basically these are some yeah these are conditions. So what happens is just imagine that uh you wanted to do something or if you wanted to drive a vehicle or if you wanted to drive a bike. So the condition you will apply on your mind is if I know driving then I will do it if not I'll not do it. So that's what you do right. So basically you apply a condition on your mind and you do it if it is capable of doing or if you are capable of doing it. So in the same way the conditional statements play a major role in computer logic. So before writing a code or before you start your program you provide the condition perform this particular operation if the provided condition is satisfied. So similarly you have these three conditional statements in Java which are if if else and nested if. So we use these conditional statements in Java to implement our logic. So we will understand the conditional statements particularly if if else and nested if in a much more detailed way by practically running some programs based on these three types of conditional statements. So now you can see that we are back on the Eclipse right now. So this particular code segment is based on the if condition. I hope the program is visible. Let's try to increase the font size. So I think it's better now. So basically we have an input. So we have the integer type of input that is num and we have the number as minus 100. So it is a negative number and after that we have the if condition. So this is where the conditional statement is provided. So the condition is if the number is greater than zero. If the provided number is greater than zero then the control should enter the loop which is this particular segment and execute the statements present inside that particular loop. So here we have one single statement that is a print statement that says the number is positive. In case the condition fails, imagine that the condition fails. Then what happens is that instead of entering this particular code segment, this particular code segment, the control will skip and execute the next statement that is another print statement which we have over here which says the if condition is terminated, control is outside the condition block. Now since we have provided a negative number the second option should go ahead. Now let's try to run this and see the output. So there you go. As expected the program got executed and we have only one statement that is if condition is terminated control is outside the block. Now let's try otherwise. Let's just eliminate the negative number. And now check it again. There you go. Now you can see the program got executed. And now we have two print statements. You can see that the condition here was true. So the control entered into the statement or the code block and this particular statement got executed successfully. Once the statements are executed and there is nothing else to do then the control will automatically exit this particular statement and it will enter into the next statement which is another printter statement and we have the same output over there. So this is how the single if statement works. So you can also modify this with an else. So that's the next program that we are going to see. We are going to execute some similar kind of example for our next kind of conditional statement that is if else. So here only we had one if condition. So in case if this particular condition fails then we will be having another condition over here which will be the else block. So as you can see we have another program. So this particular program is based on if else condition. So here you can see that we have our first if condition which states number should be greater than or equals to zero. If this particular condition is true then this statement should be executed which says the number is positive. Else else if this condition fails then what you must do? The control should avoid entering this particular segment and it should directly hit the next segment where we have the else block which has another statement which says the number is negative. So this is how the program works. So here we will be doing a little modification over there. Instead of taking an input which is previously defined as it was in the previous example where we had given minus 100 previously we are going to do it a little differently. This time we'll be taking or reading the input directly from the user. So for that we are going to use the scanner class. So this is the particular library that we will be using. So we have imported java.util.scanner. So this particular code segment will ask you for the input and you'll press some random number and it will read it as its input. Now let's try to quickly run this program and see the output. There you go. The program got successfully executed and now it is asking for an input from the user. Now let's try to provide a negative number. So there you go. The program got successfully executed and you can see that since we had given a negative number, the control did not enter this particular code segment at all. It directly avoided to enter this code segment and entered into the else block and executed the statements present in that particular else block which was a simple print statement that had the statement which read as the number is negative. Now let's try to execute the same program again and see what would be the output. So there you go. Now it's asking for the input again. Now this time let's provide a positive number. So there you go. Since we provided the number as a positive number, this condition was true and this particular statement got executed. Since one of the statements executed, there was no need for the else block to be executed again. So you can see this particular code segment runs in this way. So once the condition is checked, so if the condition is true then the true statement will be executed. In case if the conditions result then the false statements will be executed. So you will be provided with two options. So one option for true validity and another option for false validity. So this is how the if else block works. I hope you understood this. Now with this let's continue with the next type of conditional statement that is the LF ladder. So on my screen you can see there is a change of program. We have stepped into the next type of conditional statement that is the LF ladder. So basically everything will be seen. We will be provided with only one condition. So we will be checking the validity of that particular condition. So if the provided condition is true then the first one will be executed. If it is not then the second one will be executed. If the condition fails for the first two, the third one will be executed. If the first three fail, then the fourth. And if all the four fails, then we will have one last else which will print the last segment or statement. So this is how the else if latter works. So basically it's completely similar to if else but the only difference is instead of one else block we have multiple else blocks. That's the only difference. Now let's quickly execute this program and see the output. So basically we are going to take an input from the user. So we will be entering one for noodles, two for milkshake, three for fruits, four for coffee. So something like that. And if we provide anything else than 1 2 3 4 then we will be having an else statement which says it's an invalid input. So the uh flow of this particular else if statement is similar to uh the switch statement. Having said that we will also discuss something about switch statement as well. Basically we'll try to execute a program based on uh switch statement and we'll also understand the control flow of that. Don't worry about it. Now let's quickly execute this particular program first. So there you go. The program got successfully executed. Now it's asking for an input. Uh let's select noodles. That's how it works. We have the output noodles. So the choice is equals to is equals to 1. So the first one was true. So it executed the first code segment and everything else got suspended because uh this was not necessary to be executed because the condition was true over here and according to that only this particular statement was supposed to be executed. So that's how it works. Now let's switch into the next conditional statement which is this switch. So you can see that we have a program on my screen which is based on switch case. So uh you can see that there is some similarity between this particular program and the first program we dealt with that is based on operators. So we also have the default code segment over here. So this was what I was talking about. You can add a default code segment in that particular program which is the operators program and do some modifications. So this is what the suggestion I gave over there. Now uh basically what happens in this particular code segment is so we have Monday as the day one of a week, Tuesday as the day two of the week and so on. So uh to select one particular day of a week, you need to provide an input. So it's based on 1 2 3 4 and so on to 7. And if you provide anything else than 1 to 7, you will be provided with an message which says invalid input. So now let's try to um run this program and see the output. So there you go. The program got successfully executed. Now let's select the weekend day. So which would be something between 6 and 7. So 6 is Saturday and 7 is Sunday. Let's go with seven. So there you go, Sunday. Now let's try to execute this program once again and give a wrong input and see if it works or not. Let's provide eight. There you go. The program identified it as a wrong input. So it gave us a message invalid input. So that's the use of default uh code segment in switch case. So you can implement this in that operators program and check out how it works. Can be considered as a homework though not a problem. Now this is how the switch case works. So with this let's move ahead into the next concept in our Java tutorial for today. Let's get started. Let's see what strings are and how we can use strings in Java. Java strings are objects that contains groups of characters like arrays. Strings are immutable as well. Immutable means once string is created, they cannot be changed or manipulated. If we use a string hello, they are stored in a memory location like this. 0 1 2 3 4 are the addresses of the locations where each character of the string is stored. Now let's move on to creating strings. There are two methods of creating string. String lit method and using new operator. This is the syntax of string on the screen. First string type then variable name is equal to sequence of characters in double quotes. This is called as string little method. For new operator method we use new operator and value of string is given in the brackets. Now let's see a simple program to understand the use of strings with Java code. Let's create a new project. File new project. Next. Tick the box. Next. I'm going to name it as strings. And for the base package, I'm going to name it as string as well because all the programs I'm going to do in this package for strings. We have our main program right here, the main class. Now, before importing the strings, we need to import some pre-processive directives. So, for this for this, I'm going to import java. IO input output dotstar. Star means everything inside the directive. And I'm going to import java.lang. lang dot star. This means I can do all the operations that is needed for strings. So there are two ways to declare string. This is the first one. String s is equal to simply learn. Now we have a string s and it contains the value simply learn. Now I'm going to print this system.out.print ln plus s or I'm going to name it as string. I'll print string first is equal to and then I'm going to print this. So double quotes string is equal to and plus s. So let's run this program. And there we go. We have string is equal to simply learn. So it took the value of s and printed that. So let's see the next type of string. How we can declare the string. str is equal to new string simply learn. So this is the second method how we can declare a string or assign the values to string. So to print it I'm going to use string 2 is equal to and then plus str. So let's execute this as well. And as you can see we have string 2 is equal to simply learn as well. So this mean both the methods are to declare strings or to assign values to the strings. So you can use any of them. I prefer using first. So it's easy that's why you don't need to write new and string. So let's move on to the new topic classes and strings. We all know that strings are immutable. Now what if we want to change something inside the string? Then we use these methods to manipulate strings in Java. First one is string builder. The string builder in Java represents a mutable sequence of characters. It is an alternative to string class as it creates a mutable sequence of characters. Next is string buffer. String represents fixed length immutable characters of sequences while string buffer represents gable and writable character sequences. It will automatically grow to make room for additions like appending, inserting and deleting. Next we have string tokenizer. A string tokenizer object internally maintains a current position within the string to be tokenized. Some operations advance this current position past the characters processed. String tokenizer class in Java is used to break a string into tokens. A token is returned by taking a substring of the string that was used to create the string tokenizer object. Now let's see different methods for functions that can be done on strings in Java. We have lot of methods or functions in strings. These are few of the methods that are used by programmers frequently and we will be using in this series of our Java tutorial. Next, let's have a look at a program where we are going to reverse a string and compare to string. This is going to be an interesting program and you will be able to understand string a lot better. So let's get started. So first we'll see how to compare two strings and then we'll see how to reverse a string. So let's create a new project. File new project. Let's click on next. Tick the box. Next. I'm going to rename it as compare and reverse because I'm going to do both the programs in the same program. And we have our main function here. To use some classes or to use some methods, we need to import some of the strings from Java. So I'm going to import strings dot compare. compare dot string compare. So let's write our code here. So I'm going to use four strings. First string s1 is equal to then I'm going to use new string and I'm inside it I'm going to name the string as simply learn s capital and for the next string string s_ub_2 is equal to new string uh let's give it as practice for the third string s3 new string let's give it as study and for the fourth fourth string we are going to match in the third string to show all the outputs that's possible study now we are going to display some output using the function equals so what equals does is it compare two strings so first I'm going to use make it as user friendly by writing comparing string one and then comparing string two and then semicolon so that everything will be separated you can easily find out what the result will be and then this is the main part s_ub_1 dot equals and in the bracket s_ub_2 because we are comparing s_sub_1 and s_sub_2. So s_sub_1 dot equals s_ub_2. So this function automatically checks whether s_sub_1 is equal to s_sub_2. Now same thing we are going to do with string s3 and string s4. Again this user friendly s3 and s4 semicolon s3 dot equals s4. We we know that s_sub_1 is not equal to s_ub_2 but s_sub_3 is definitely equal to s4. So let's try it with one more sentence so that we can compare one more string. So I'm going to compare s_ub_1 and s4. So I'll copy paste it and instead of s3 I'll write s_ub_1 and same I'll do with s_sub_1 dot equals s4. So let's run this program. Oh before running we have a error here. So I'm going to delete that import because we have not used it. So now let's run the program and yes we have a result comparing simply learn and practice is false. That's definitely false. Study and study both strings are matching. So it's true. and simply learn and study they don't match that's why it's false so let's get started with our second program that's reversing a string so I'm going to delete everything from here and I'm going to write same code here only so first I need to assign a variable of string string input equals I'll name it as simply learn and this is the main part guys we use string builder because the string is immutable as we discussed earlier string builder allows us to do manipulation. So I'll use one more variable input one and new string builder. So in input one we can do any manipulation that we require. So first I'm going to do input one dot dot append so that I can do operations that I want on it either reversing or deleting or concat. So I'll take append of input and lastly input one is equal to input one dot reverse. This function reverse the string that is there in input one. Now to print the value of the reverse string, the reverse string is and then input one. So here's the catch guys. We have to use string builder so that we can do manipulations inside the string. If we don't use string builder, then we will get an error that unable to manipulate the string or unable to reverse the string. So string builder is the main thing here so that we can do all the operations that we want either reversing or concat or deleting anything from the string or deleting an element or adding anything to the string. So all that happens because of string builder. So now let's run this program and there we go. We have our result. The reverse string is the reverse of simply learn. Now let's try it with something that is pelindrome. So we have our language malam. If we reverse this we'll get malalum. So this is kind of pelindrome string and see the result. The reverse string is also malam. So this is how you reverse a string. So this brings us to the end of this video. We learned about strings, the functions for strings and the methods we use in strings. And lastly we learned how to compare to strings and how to reverse to strings. So as I described earlier that array is basically a container which can store values or a sequence of values or sequence of numbers or sequence of characters into itself. We can think of it as a box which can store all the values in a continuous fashion. As you can see here this is a just a pictorial representation and this is coming from the official Java docs. And you can see that we if we create an array of size 10 then we have these 10 blocks created here. You can see 1 to 10th. So the whole length of boxes the number of boxes here are 10. But the way arrays are designed is that the index index is basically used to access the element in this particular box. The index of the boxes start from zero. So it goes from 0 to 9. So remember the array length is 10. It array the array can contain 10 elements. But the index of the array starts with zero and will always end at length minus one which is 10 - 1 in this case which comes as 9. So it will always be length minus one. It will always the index will always start from zero and go till length minus one. Length can be anything. In this case the length is 10. So the index ends at 9. If the length was 20, the last index will be 19. But in total, you have these 10 memory locations. We also call them as continuous memory locations because they are continuously placed. An array basically blocks 10 memory locations and creates a container over it. So this is how an array basically looks like inside the memory. And whenever you want to access the elements of the array, you will say array of zero or array of one or array of two. You basically need to specify the index to access the element at index. For example, if you want to access the element which is sitting in this box, you need to say array of index 8. And we'll see how we can do that. But this is the basic uh understanding and idea of the concept of arrays. So let's try to understand this with the help of an example. I will switch back to Eclipse IDE and I've created a very simple program here to demonstrate the functionality of arrays here. So we already covered in the previous lecture of what is package and what is public and what is class. How do we give the class name and what is the meaning of this particular method. So I'm not going to cover that again. We'll start directly from here. So here the first thing which I'm doing is I'm declaring an array of integer. This is a variable name. the identifier basically it can be anything and this is the data type it's an integer array and as we as we covered this as well that whenever you put square bracket in front of a data type it becomes an array data type so this is an integer array representation now we just declared an array but we still haven't allocated a size to it so you can do that with this particular uh syntax so you can put the variable name of the array and say new int and put the right size here. This size can be anything. And once you do this now array will actually allocate those memory boxes which we covered here. The moment you do new int 10 this box these boxes continuous boxes will be placed in the memory and the memory is allocated to this array. We call this memory allocation. This is how you allocate memory to the array. So we allocated memory to this array for storing 10 integers. The next thing is now we can start storing elements in those boxes. So like I said that the array index always starts with zero. So if you have to store the first element, you actually have to store it at index zero location. So you give the array name, you provide the square brackets and you put the index value within the square brackets. That is how you basically point to a particular element inside the array. So we say an array of zero and we put the value 100. Then we initialize the second element which will be index one. Then will be the third element which will be index two. Fourth element index three. Fifth element index 4. Sixth element index 5 and so on until we store till the last element. So this is the 10th element which is accessible as index 9 and the value is uh 1,000 basically. So from 100 to,000 we stored 10 values in this array and we stored them by accessing the index and this is actually the only way you can store values in the array by pointing to the indexes. So we go from 0 to 9 and we stored all the values 0 being the first element and array of 9 being the last and the 10th element. Remember the length minus one concept. Okay. So now we will try to print all the elements one by one. That's pretty much what we are doing now. So as we covered in the previous lecture that we use system.out.print ln to print anything and we understood the whole meaning of this. So I'm not going to repeat that. Now uh we want to print the first element. The first element is sitting at index zero. And we can access that element with this syntax by providing the variable name and the actual index value. So I'm just writing a random string here which says element at index zero and then I'm putting this plus here and putting the variable name. This plus is basically used to concatenate the output of a static string with a random variable or basically you can print anything uh with using plus. Plus is used for concatenation. So I'm just trying to print this whole value. But here this is a string value which is a static string and then I have a value coming from the array. So whenever you have to print some value from a particular data type or variable or collection then you can use this plus syntax to concatenate a string static string with your actual value. So that's what I've done here by saying plus an array zero and similarly for index one I'm printing the the first index then for two three so far and so on so forth till the index 9. So basically I'm just printing the all the values of the array starting from index 0 to index 9. So that's all which which is written in this program. Now let's try to run this program. So I will right click go to run as and go to java application and hit on this. And now if I just expand this console you can see all the system.out.printlen statements have been executed and they printed this. So this is the static uh string part in fact including the colon. This is the static string part. Element and index zero printing exactly as is. And then dynamically the zeroth index element of an array is printed here. Similarly, we have printed the index one location element, index two location element, index three location element and so on so forth till the index 9 location element. So in total these are the 10 elements but the index always works from 0 to length minus one. In this case, it will be going from 0 to 9. So this is basically all which I wanted to cover in this lecture. The whole idea was to give you more understanding of arrays. And remember this is just an integer array. You can similarly create a character array. You can also create a string array for uh for you as well. So it it it's completely uh it's completely related to the data type you're using. If you create a car array, then you can only store characters into it. If you create a string array then you can only store strings into it. And now you can probably relate back to this particular thing which I explained in the previous lecture that we create this string array for the reason that when you run this particular program and if you want to provide any command line values command line arguments to the program those arguments will automatically be stored in this args and then you can access this as args of zero args of 1 etc in your program. That's the whole concept. Let's get started with understanding arrays in detail. We have been talking about arrays throughout this course of Java in the previous sessions as well. And we have covered some basic understanding of how to create arrays, how to declare them, how to fill values in the array and how do we print the array with positions as well as the array as whole. But whatever examples which we took previously were one-dimensional arrays because arrays can have more than one dimensions as well. You can create a one-dimensional array. You can create a two-dimensional array. You can create even a three-dimensional array and you can go up to as many dimensions as you can handle in your Java program. So it depends upon the kind of complexity you want to have in your program and the kind of values the kind of structure you are going to store in your arrays and based on that need you can choose whether you want to use a 1D array or one-dimensional array or a 2D array or a 3D array and so on. In these sessions we are going to talk about 1D arrays, 2D arrays and 3D arrays and after that we'll leave up to you to try out more dimensionals if you want to. We have already covered the basic array structures which were one-dimensional arrays. So I will just give you a quick walkthrough of how we actually handled one-dimensional arrays. So this is a sample program to demonstrate one-dimensional arrays. If you remember this is how we used to create arrays. We write the data type of the array and then we write the square boxes which denote that this is an integer array data type. We assign a variable to this and then we initialize the array with a size four. So new is the keyword which is used to initialize anything in Java and we are going to use this heavily when we talk about classes and objects and even collections. Literally any object which you want to create in Java requires a new keyword. So here I'm writing new and then int which means create an array of size four and then I'm filling the value of the four positions which I have created as part of this array. And if you remember when we create these kind of arrays, we store them in a zero index based position the first value gets stored at zeroth index position and then so on so forth. So it will always start from zero and never start from one. Remember that. And after that we just print all the values of individual positions of the elements in the array. And if I just run this program, all of the elements of this particular array should be printed one by one. So if I just show the full console of the output, you can see that element at index 0 was 10, element at index 1 was 20, element at index 2 was 30, and element at index 3 was 40. So this was just a quick refresher of how one-dimensional arrays can be written. And whenever you declare a very simplistic array, it will generally be a one-dimensional array. Now let's look at the two-dimensional arrays and how do we write them? When do we need them? For that I have created another example which is says two-dimensional array. I just created a class and it has a public static void main method and I've created a two-dimensional array this time. So let's understand this two-dimensional array in a bit detail. And when do we need that? Generally you would need to use two-dimensional arrays whenever you are trying to do any matrix calculations. If you if you understand what do we mean by matrix? It's basically a 2x2 structure which stores the values in the form of rows and columns. So imagine a table of two rows and two columns. Then it will be a 2x2 matrix. So if you want to store that particular table in a Java program, you would need to store that as a matrix as a two-dimensional matrix. Rows being the one-dimensional and column being the other dimension. And that's what we are doing here. And if you want to store that 2D matrix in a Java program, the approach and the procedure for it is pretty similar to how you create a one-dimensional array with slight changes. The first change is instead of a single square bracket, you're going to write two square brackets because it is a two-dimensional array. So remember the number of square brackets you are going to put while initializing and declaring the array is the number of dimensions which your array is going to have. Since this is a two-dimensional array example, that's why you see two brackets here. If this was a three-dimensional array example, you will see three array, three square brackets here and so on so forth. So that's the first part of it. Second part to understand is to how to store the data. Remember I told you always imagine the structure of rows and columns whenever you are trying to store a two-dimensional array in Java. So what are rows and what are values and how do you represent them while you declare and initialize a two-dimensional array. So you start with the curly braces as a normal 1D array but inside the curly braces you create nested curly braces blocks. We can see three blocks here. They start with their own curly brace and end with their own. Then this curly brace starts here and ends here. And then this curly brace starts here and ends here. Idea is that you provide this outer curly braces to define the overall structure. And then inside each of the curly braces is going to represent a row in your two-dimensional array. So each of these values, these blocks is going to represent a row. So I can say that this is the first row, this is the second row and this is the third row. And if I try to visualize it in terms of columns then this is the first row first column first row second column first row third column. Similarly second row first column second row second column second row third column and third row first column third row second column and third row third column. So individual values are going to be represented as columns. And the whole curly braces is going to be represented as arrays. That's the basic mental idea or mental image you should have while declaring a two-dimensional arrays. Remember to declare the rows inside the nested curly braces. And whatever elements you have will automatically be indexed as columns. Another thing to remember that since this is an array data structure, everything starts from zero and nothing starts from one. So this will be row 0. This will be row one and this will be row two. I'm talking about the position. We can still call it as first row, second row and third row. But the position of this particular row element is zero. The position of this particular row element is one. And this particular row element is two. Similarly for column as well, this is column 0, column 1 and column 2. Similarly, column 0, column 1 and column 2 and so on so forth. Once you understand this data structure well and you have defined it correctly then everything should fall in place. If you want to do a matrix addition or if you want to do a matrix multiplication or a dot product all of the kind of calculations can be performed using the 2D array concept. Here in this program what I'm doing is I am printing the values of this particular 2D array into a matrix style. And you see some strange code here which is for etc. Don't worry about this. I'm going to cover in detail what this four means and how do you write this. For now what we can understand that we just want to print this. You might not need to print this in your Java programs when you write a production grid application. But you might want to do manipulations on these uh arrays as matrix. Maybe you want to create a transpose of a matrix or you want to do a dotproduct or addition or subtraction or whatever be your use case. In this case, just for demonstration purpose, I'm printing the values as rows and columns. Nothing else. So this all of this code from line 8 to line 14 or in fact line 13 is just showing how to print the values. You can see some system.out and you can see some construct here. And like I said, don't worry about this. I will cover this in detail. Let's run this program and see if my Java array is stored correctly and how can I represent this. So you can see I have represented it in a style of a 2D matrix where this is the first row, this is the second row and this is the third row. Similarly, this is the first column containing the value 23 7. So column 0 will have value two and column 1 will have this value three and column 2 will have this value seven for row zero. Let me also do something here which can help you understand this concept better. Let me do a system.out.print ln and let's print an individual value because like I said the for loop can be confusing here to understand. So let's say I want to print a ar r of zeroth row first column and see what kind of values do we get. Let me comment this code. Comment is control backslash and this code will be commented and this code will not be executed. And now only line 15 will be executed instead of the fourth block. So if I run this I get the value seven. So row zero and first column row 0 first column is seven. Let's try with 1 one. I want to print the row at Z one position remember not the first row but the one position row which is basically technically the second row. So second row second column and see what kind of values value do I get in this case I get six. So second row, second column. Similarly, if you change this value to two, then third row, second column, which should point to four. Yes, we get four. Similarly, you can write a value here as zero and you can write a value here as let's say two. This will print the zeroth row and the second column. So similarly, whatever kind of value you want to write you or you want to access, you can access it in this fashion. And remember the column and row indexes will always start from zero. So this is a simple demonstration of how you can use two-dimensional arrays. And in this session we also did a refresher of one-dimensional array. Let's get started with how to create and use a three-dimensional array or how to go about using multi-dimensional arrays in Java. So as you can see from this image, we talked about 1D array which is having just one axis. Then we talked about 2D arrays in the last session where we had rows and columns basically an x-axis and a y-axis. And then we can also have a 3D array which will have three axises which will have an x-axis, a y-axis and also a zaxis. Think of a simple box which every box in this world will always have at least three dimensions. And from from here you can go even build more complex arrays which can have four dimensions or five dimensions or as many dimensions as you want it to have. And today we are going to look at an example of how can we build a 3D array and how do we access those elements. But this picture is just to show you the mental model of when you will be creating a 3D array. So for example generally an image data is stored in in three dimensions. So you can you might want to store the image data into a 3D array and there can be many other use cases in the mathematical and research computational use cases where you might want to use a 3D array. So but remember there's an X-axis, there's a Y-axis and then there is a third axis which is called a Z axis. So let us look at a Java program to understand how we can build a three-dimensional array and for that I have created this class which is called multi-dimensional array. It has a entry point method which is the public static void main method and then I have created an integer array and this time instead of one or two square brackets I have three square brackets and if you remember I mentioned this in the previous session as well the number of square brackets which you're going to put while initializing the array is the number of dimensions of the array. And since in this particular program I'm going to demonstrate a three-dimensional array. That's why you see three square boxes. Let me just minimize this. Yeah. So we have three square boxes here. And we have created the variable name as a r or short form as array. Then we start with the outermost curly braces as is. Then we put another curly braces which starts from here and it ends here. Then another set of curly brace which starts from here and end here. So this is the this is the first dimension. This is the second dimensions and these are the third dimensions. That's how you're going to define the different dimensions. Remember this is the first dimension when the first curly brace starts. Then you have this second dimension which covers this hole and this hole. And then you have third dimension which are these. So that's how you are going to visualize and and put the three dimensions in use while declaring a three-dimensional array. And the values work in the same fashion. It's it's a zero index based position. So since we do not have an official name for the third dimension, so I'm just going to use x-axis, y-axis, and z axis to refer to the three axises. So this would be x of 0. This would be y of 0. And this would be z of 0. Similarly, x of 1, y of 1 and zed of 1 and so on so forth. So now if I try to access a value which is at zero x position, first y position and second z position. What's the value do we get here? Let's run this program and understand and interpret the output. Okay. Uh so when we ran this program, we got the output as 11. So let's understand this output. So when we say the zero position on X, the first position on Y and the second position on Z. So this is the zero position on X and this is the first position on Y and then this element is 012 is the second position on the Z axis. So to to describe it in a nutshell, this defines the x-axis. So we have two elements on the x-axis here. This one and this one. Then we have two elements on the y-axis on each x-axis. So this is one. This is two on the first x-axis. And this is one and this is two on the second y uh second x-axis. So 2 x and 2 y. And then on the z axis I have three elements each. So hope this helps you understand and visualize this. So x-axis and this one is other x-axis and then yaxis y-axis and then elements inside this are z axis. So I'm saying zero x-axis in this block first on the y-axis which is this block and then second element or the z or second position element on this particular ax in this particular block which is 11 and that's why we get 11. If I print zero, let's say I I change this particular value as one. So now the output should be coming from this side. So second X position because it's one. Second Y position. So this will go here. And then the two position which is the third element of the Z axis which is 13. So let's see if we get 13. Yes, we get 13 here. So this is just to show you how you can interpret this particular array. And always be mindful of how you are structuring this array. If your structure is gone wrong, then your program will become useless and it will give you lot of unpredictable outputs which might not make sense and which may introduce errors in your program. So be very careful how you define the structure of the elements here. That's the key. And after that you just need to understand the x-axis, the y-axis and the z axis. Always remember all the axises start from zero. So when I say two, I'm basically referring to the third element and not the second element. So this is all I wanted to cover in this particular session where we describe how we can use a three-dimensional array. And from here you can go to any lengths. Like I said, you can add more square brackets here and go to four dimension or five dimension or six dimension. But remember the more dimensions you add, the more complexity of the program will be having. The program will become more and more difficult to debug and understand. So always try to take a wise call as to how many dimensions you want to use in your array. >> And software developers need to stay upto date on the latest advancements regarding the tools, frameworks, programming languages and apps to achieve success. Master the latest coding tools, strategies and techniques through simple and software development courses. By enrolling in any of these certification programs, you will gain expertise in skills like agile, Java, DevOps, HTML 5, CSS3, AWS, JavaScript, ES6, SOAP, and REST and GSP. With hands-on experience in tools like Angular, MongoDB, you'll catch the eye of top recruiters. So, what are you waiting for? Hurry up and enroll now. A year of experience is preferred to enroll in these courses. You can find the course link in the description box below and pin comment. Welcome to this tutorial on objects and classes in Java. This is a part of our Java tutorial series where we will be covering everything you need to know to master Java. Let us look at what we will cover today. First, we will talk about objects and we will implement two programs on Intelligj to learn about objects. Then we will move on to classes in Java where we will see an advanced program to learn classes more in depth. So what are objects? An object is an instance of a class. Let's have a look at an example. In this example, animal is a class and dog is its object. The object dog has states and behaviors. We can have dogs with different breeds, sizes, and colors. These are considered as the states of object dog. On behavior side, dog has behavior like barking, eating, and wagging tail. So, an object has its own states and behaviors. Now, let's look at an example using Java code. There are many platforms to run Java program. So for this video I'll be using IntelliJ. So let's create a new project. Let's name it as project one and finish. There we go. We have a new project with we have a class with main and we have a main function. So the code that we write should always be written in the main function. So let's create a new class to understand how the object is used. Let's name it as student. We need variables so that we can access the variables of this class. So I'm going to use student ID with the integer type, student name, and students age. There we go. Now we have these three variables that we can use. So let's go to our main program and start our coding. So we have a class named student. Now let's see how to create a object of a class. This is the syntax to create a object. Now the object here is S. I created a object S of class student. Now let's assign values to the variables. For this we use the object S and use the dot operator and we have options from which we can choose from that we declared in the class student. So for this I'll use ID and give a value. Similarly, I'll give age and give a value. And finally, let's give a name. Now, we'll print its value. Now, we are going to run this program. Let's see what output we'll get. And there it is. We have name. That's simple learn. We have age and we have ID. Now let us see an example how we can use multiple objects for a single class. So let's get started. Let's create a new project and I'm going to name it as vehicles because I'm going to use cars and bikes in this program. So I'm going to use vehicles as a combined form. And yes, here we have a class main and a function main. Now I need two classes for this program. So I'm going to create two classes. First I'm going to name it as bikes and the second class I'm going to name it as cars. So let's create variables for these classes. So in cars first I need string name and I need the cost of the car. So cost can be integer as well because I'm going to use dollar sign in that. So I'm going to use string because of that. So same thing I'm going to do with bikes. Now that our classes are created, let's create objects for this class. So the process is same but we are going to use different names for the object. First the car class and I'm going to name as car one and yes we have created the first object. Now to create the second object similarly I'm going to create five objects of the class cars and I'm going to change the name for them. So I created five objects of the same class. So I'm going to create five objects of the bikes class as well. So bike one will be a bit longer. So I'm going to use B1 till B5 and I'm going to name them to from B1 to B5. So now I'm going to assign values to the variables that I created in classes bike and cars. So first I'm going to go with cars and let's name it as Lamborghini. Similarly car to Ferrari. So I'm going to use names of the cars that are very famous and costly so that anyone over the world can understand this. So let's name car 3. I'm going to name it as Bugatti. Similarly car 4, Pagani and car 5. Now I'm going to give names for bikes. I hope everyone will understand the names that I give, B4 and B5. The last one, Yamaha. Now let's assign the cost for bikes and cars as well. So the procedure is same. So let's do at 130,000. Same B2. So B1 goes for Harley Davidson, B2 for Ducati, B3 for Suzuki, B4 for EOS and B5 for Yamaha. I'm going to assign values for these values accordingly. for Ducati $232,000 for Suzuki 200,000 300,000 and the last one Yamaha 500,000. Now similarly I'm going to assign values for car 1.cost till card 5.cost cost $23,000 for Lambo. I think I can copy paste these as well. So, let's copy paste. It will be a lot faster and easier to do. Car 2, car 3, car 4, and car five. We don't need this. uh as per car 2 let's take it as 252,000 and uh let's make it as 3 million uh as per this let's keep it as 1 million 400,000 and lastly uh let's take as 293 now that we have assigned all the values for all this now let's print it and get the value I'm going to create a very simple program but a very userfriendly program. So it it's going to be interesting for you guys. So we are going to ask the users what would they like either bikes or cars. So we need to give them the options and our next program will be based on the options that the user select not the options we give as the command. So let's do it. Let's give the options one bikes and two cars. I need to take the value that user gives. For this I'm going to write this command. So I have not used scanner yet. So let's import scanner. And let's create a object for scanner and yes let's get back. So the data type of choice variable is integer. That's why I'm using next int. If the data type was string then I would have used next line. So now that we have choice from the user, let's use this value. If the user chooses the first value that means bikes. So the next thing we display is we have models and we're going to give five models for bikes to the user. Here I'm giving options to the users so that they can choose easily from number 1 to five. Now we can show these options to the users so that they can choose from one of these value. So let's use one more if statement so that we can find out whether they have this value or not. Before that I'm going to ask which one would you like to choose. To enter the choice I'm going to use one more variable. Let's say n. So I'm going to store n. If n is equal to equal to 1 that means Harley Davidson then I'm going to show the cost of Harley Davidson. This is the syntax to print the value for the cost or any of the variable that we use in class. What if the user says second or third or fourth or fifth. So for that we are going to use else if statements. If n is two that means ducati. So we have to show the rate of ducati or the cost of ducati to the user. Now similarly I'm going to do for n= 3, n= 4 and n = 5. Now I'm going to do for n = 4 and lastly n is equal to 5 that is a last bike yamaha. What if the users put a number that is not between 1 to 5. So for that I'm going to use else statement and put a message that please enter the value from 1 and 5. So now we have code for the bikes and the same thing what if the user selects that he wants to find the car. So for that we have this the choice is equal to is equal to 1. So the same thing we are going to do for choice is equal to is equal to two and the same thing we going to tell to user that we have five models. The same names that I gave to variables. I'm going to give this to here. Second one Ferrari. Third Bugatti. Fourth EOS and the last one Porsche. Now we are going to ask the users their choice that which number do they want to choose. Now we need one more value so that we can have it as a variable which can store the choice of the user. So for this I'm going to use C. Now if C is equal to equal to 1 that means if the user wants to see the cost of Lamborghini that he puts the choice as one. So we're going to display this message the cost of Lamborghini and we're going to use else if loop to enter the next values for C from 1 to 5. If C is equal to is equal to two that means the user wants to know the rate of Ferrari then we are going to show the cost of the Ferrari. Same thing if the user enters three as the choice. If user enters four as their choice then we go for eourse. And the last one if user enters the choice as five then we have to display the cost of posh. Now what if the user enters none of the values from 1 to 5? Then we have to display a message showing that please enter the value between 1 to 5. Now remember the first choice that we wanted from user to enter either bikes or cars. So what if the user do not enter either one or two. So for that we need one more else function to tell the user that either enter one or two. And with this we have completed our code. So now let's run this program. For this we need to go to run and then run main. There's a shortcut for it that is shift + f10. So let's run the program and yes we have successfully executed the program. Let's test this program now. So enter your choice. I'm going to enter one and yeah we have five models. Harley-Davidson, Ducati, Suzuki, Pagani and Yamaha. So enter your choice. I'm going to enter one. And yeah, we have our result. The cost of Harley-Davidson is $130,000. So with this we have completed our code. And please feel free to type this code in your own computer and try out all the permutation and combinations that you can with this program. So with this let's move on to classes and understand the classes and their concept. Then we'll have a new program on classes. Now let's see what is a class. A class is a blueprint from which objects are created. A class describes state or behavior of an object. In this example, dog is a class. The variables in this class are breed and color. The functions or methods of the class dog are barking, hungry, and sleeping. We use objects of a class to use variables and functions of the class. With this, let's understand classes with a simple Java code. Let's create a new project. Next, tick the box and let's name it as automoils. Let the base package be student. And yes, we have a class main. Now let's create some classes to do code on. I'll create a new Java class as cars. And then I'll create one more class with the name bikes. And then one more class automobiles. So I'm going to connect cars and bikes with automobiles so that we can use that program in main and see what can we do with the classes that we create in automobiles. I need some variables. I'll take private double and let's say fuel and then same thing private double and then year. And let's take one more private string and brand. Now let's have getters and setters for this. So these are used to get the value and set the value for the variables inside the class. There we go. We have the getters and setters for it. Now let's go to class cars. So public class cars extends automobiles. So in it I'm going to create one more class or a constructor and I'm going to print a message say a new car has been created. Car has been created. Now the same thing I'm going to do with bikes. Let's go to bikes and I'm going to use the same thing. extends automobiles. This is because I can inherit all the variables from the automobiles class. So I created a constructor and I'm going to print a message. A new bike has been created. So I have created class cars, bikes and automobiles. So let's go to main program. So this is where we should write our code. So I'm going to start with the code. Now it's a very simple code. I'm going to first I'm going to create the variables or the objects of the class with private bikes bike. So one is car and one is bike both are objects for the classes. So I'm going to use this objects bikes bike is equal to new bike. This is so that my object can function really well. And now I'm going to run it. It will take some time to run. And yes, there we go. Our program has executed. And the things that I typed, a new car has been created, a new bike has been created are done. Now let's try something else using the classes. So I'm going to bikes. So I'm going to create a new method or a new function public void kick for bike. So I'm going to print message. The bike has been started with kick. Bike has been started with kick. Now the same thing I'm going to do with cars. Now how does a car start? With a key. So I'm going to make a function public key and inside it I'm going to print the same message car has been started with key. I should write void there to give the return value as void. So let's print the message car has been started with key rotation. Let's write that as well. So in the main program I'm going to use objects to use those functions and let's see what changes they'll do to our program. Pike.kick and car.kick. Let's run this. And there we go. First we used to have this two messages but now these two messages are also there as well because we invoked those functions and methods that are there in class cars and bikes. So if I write bike dot key or car dot kick this won't work this is because key is not a method of bike or kick is not a method of car. So that's why I gave private static for the functions. So if I execute it, these are the error messages that I'll get. Cannot find the symbol method kick or method key. What is polymorphism? According to chemistry, the term polymorphism can be defined as the ability of any element or compound to exist in multiple crystalline forms. This is called polymorphism. For example, if you have the carbon atom, it can come out in different forms in coal, graphite, and diamond. What is polymorphism in Java? Similarly, in the terms of Java programming language, polymorphism is defined as the ability of any object in CLA in a class to perform a particular task in multiple methods. This is known as polymorphism in Java. We're going to open up our Eclipse editor and we're going to do some animal sounds with cows, cats, and dogs. Just kind of a fun almost kids-like uh example of polymorphism. And uh you can see I already have my inheritance in here. Uh let's go ahead and create a new uh package. And we'll call this polymorphism just to keep it simple. And once we have our polymorphism in there, we're going to go ahead and add a class in. And if you were doing um an abstract class, we can label it as abstract. We're not going to directly access it. And we'll call it animal sounds. Maybe we will. We'll see how we uh load the um program up, but we'll call this animal sounds. And let's create a uh public um it's not going to return anything, but we'll call it sound on here. And we just want to go ahead and have it do a uh system out print. And with our system out print line, uh we'll just have it say animals make different sounds. There we go. So, you know, it's really simple and straightforward. We're just going to have it print something out. And uh if we're going to do that, let's go ahead and just um uh Good thing I didn't make it abstract. Let's go ahead and just test it out and see what it looks like. and we'll do um oh we'll call it animal main. Animal main. And in here, let's go ahead and test out what we just put together. Uh we'll do our our static void main. So, it's going to run on here. And we'll create our animal sounds. We'll call it animal because we don't know what kind of animal this is. We'll call it new animal sounds. And we'll just take that animal. Um, and I like to put it in capitaliz, but usually we like to do this lower case. There we go. And we'll just have our animal uh dot sound end. And let's go ahead and run this and see what comes out. We can see here animals make different sounds. Okay, that's not too exciting. Uh so let's jump in there and let's say we have um in this case we're going to add in a couple of different animals. Uh we'll add in a oh let's start with a cow. You know why not a cow? Um so we'll have our cow in here. We'll go ahead and click okay. And now we have our cow class. Uh but a cow doesn't just it makes different noises but it actually um uh makes a you know a very clear noise. Okay. So, we'll go ahead and give the cow a sound. And we'll have the cow um say moo. And the cow is going to extend. There's our um and then we'll put in our extends animal sounds. And then I want to go back here to our animal main. And now we have a class cow. So in our animal main, we want to do cow. cow equals new cow. And once we've created the new cow, we also need to go ahead and have the cow sounds. There we go. And we run this. You can see it comes out here and it says the cow says moo moo. So if we go back to cow, we're just going to do this real quick. And let's say um we just take this out of here, the public void sound. And then we're going to go into our animal main and run that recompiles. Animals make different sounds because it doesn't know what sound a cow makes. Uh so this is really central to polymorphism is we're taking something going on in the um in one setup that we've brought in and extended from our animal sounds and we've changed it to the cow says moo moo. And we can also add in multiple animals in here. We'll go ahead and just add in one more animal. Uh we'll call this one, we'll do a dog. Why not? Uh so here comes in our dog. And of course, we want the dog uh to actually say something. And we'll have the dog uh go bow. And then we'll go back to our animal main. We have to create a dog. And we'll say cow. simply dog dog uppercase for the class, lowerase for the actual object. And then of course we need the dog to make a sound. So we'll go down here and go dog sound. And when we run this, as you expect the uh it's going to compile it. There we go. Animals make a different sounds. The cow says moo moo. The dog says bow wow. Characteristics of polymorphism. The functionality of a method behaves differently in different situations. The behavior of a method is dependent on the data. Polymorphism is mainly used to implement inheritance. As we saw, we did the extends with the animal sounds. Polymorphism is mainly used to implement inheritance. It allows same name for a member method in a class with different types which we'll cover briefly in a minute. Polymorphism supports implicit type conversion. Types of polymorphism. There are basically two types of polymorphism that can be occurred in Java programming language. They are mentioned as follows. Compile time polymorphism, runtime polymorphism. Compile time polymorphism gets executed during the compilation stage. Here the overloading method gets resolved in compilation stage. So when you saw me run those in Eclipse and I went through the compile time, that's looking at all the different changes we made to those classes. That's what we're talking about here is during compile time in method overloading in Java. The process of method overloading is achieved when a class has two or more methods with same name but the specific method is selected based on the number of parameters declared. We'll now execute a program based on the functionality of additional operator in a different situation. And let's flip back on over to our Eclipse. So in here, I'm going to go back under the dog and uh let me just highlight this and we're going to do the same thing. So you see right here it says public void sound. So this is identical public void sound, but instead of sending uh nothing, we're going to send it a string and we're going to call it angry. Now at this point, you should note that what if it's a happy dog? I would have to add an if then. If the string angry said happy, then we'd print happy or something else. Um, but we're just keeping it simple. So, we've entered another sound identical to the first, but we've added string angry to it. And this one's going to print out the dog says growl growl. Now, if we go back to our animal main, here's our dog. Same dog. Uh, same sound, but now we're going to add a string in here. And we put that string in here. We'll go ahead and just call it angry. It doesn't really matter what string you put in here because we haven't sorted out what the string means. Uh, for now it just says uh growl growl. It's going to recompile it. So remember this is a polymorphism during compile time. And here we have it. The dog says growl growl. So the dog says bow and then the angry dog says growl growl. So there is another um thing called operator overloading. Operator overloading is not supported in Java. Authors of Java wanted to keep the language less complicated. explaining operator overloading. It basically is a way of bundling operations into the call statement and user procedures. It's so that it looks like a math on a paper. You have a plus add b plus c kind of thing and it's all wrapped up in your call to another statement. This just gets confusing. It really isn't necessary. So the Java developers decided not to put it in there. So runtime polymorphism in Java programming language. Runtime polymorphism gets handled during the program execution stage. Here the overwriting method gets resolved in execution. So far we've talked about compile time polymorphism. As you saw in the program we just wrote when it's compiling it does the extend and figures out which overload method to use on there. In runtime polymorphism, method overwriting in Java, the method overwriting is a procedure where child class is allowed to implement a specific class that is already provided in the parent class. For runtime compilation code or polymorphism, we need to go ahead and introduce the super keyword. Now, from inheritance, you should remember that we can uh look at super from before, but we're going to use it slightly different. It's kind of doing the same thing as when we did the inheritance, but we're doing like what they call an override during runtime. So the term super is predefined keyword in Java that is used to refer the immediate parent class object or method defined in the program. In this procedure, whenever you create an instance of subclass, then automatically an instance of parent class is also created that will be implicitly referred by the super reference variable. So, going back into our animal sounds, let's go in here to dog. And if we add a super dot sound in here, this is going to reference whatever our extend is because we extends the dog extends animal sounds. And so, here's our super sound. And if we go ahead and run and compile this, and you can see here that it comes down and says the dog says growl growl because that's what we had it um system outprint line to. And then the super animals make different sounds. And so if we go back to our animal main, this is what it's calling right here. It's going back into sound under the animal mains and it's printing out or doing whatever it does here. At this point, we usually have it return something. So you can look up whatever um the original class was using. So getting back to uh these two setups, whether you're using the super to use a runtime polymorphism because that's what's happening during runtime versus compile time polymorphism. During compile time polymorphism, method call is handled by the compiler itself. So the program may take a second more to compile, but it runs faster. In the runtime, the method call cannot be handled by compiler in the execution stage. So if you have any errors, it's not going to show up either. During the compile time, we have compile time polymorphism is less flexible as it needs handle all method calls in compile time. So you really in runtime polymorphism you're it exhibits higher flexibility as a method call gets handled at runtime coming in the execution period for compile time polymorphism is less u that's what I was just talking about it compiles it so the compiling takes maybe a little bit more but if you're executing the same program over and over and over again once it's distributed it's going to run faster then of course with the runtime polymorphism the execution period for runtime polymorphism takes longer it's just a little bit more Usually in most programs, you don't notice this, but if you're executing the same script a thousand times, suddenly that 0.01 second is a lot more. It it suddenly is adding up a second each time it goes through the thousand iterations. Uh then with the compile time polymorphism, integrating the right method call with the right method is done in compile time. And of course, in runtime, integrating the right method call with the right method is done in runtime. Again, that's another delay because it has to figure out what it's doing. It's not already pre-mapped out. And finally, compile time polymorphism occurs during method overloading and operator overloading where runtime polymorphism occurs during the method overwriting. Advantages of polymorphism. Programmers code can be reused via polymorphism. Number one goal of a programmer is to reuse the code as much as possible so you're not reinventing the wheel over and over again. Advantages of polymorphism. Supports single variable name for multiple data types. Reduces coupling between different functionalities. And some of the disadvantages of polymorphism that can come up is that polymorphism ends up raising performance issues in real time. Uh you can see where as you're loading all these different things, you might end up creating loops you didn't know you were doing. Polymorphism reduces readability of the code. uh sometime your actual code everything you look at in Java is polymorphism all based on a primary object. So you could have a very complicated setup and then it actually is very easy to read when you actually put your final variable in there. But when you're going through lines and lines of code, it can be really hard to uh figure out what's going on as you loop through all these different inherited modules or classes. Programmers find polymorphism difficult to implement. just depends. The more you use it, the easier it is. >> Let's see the definition of encapsulation. Encapsulation is like a capsule. The whole code and data is bounded together into a single unit. Another way to think about encapsulation is it is a protective shield that prevents the data from being accessed by the code outside this shield. As you can see, variables and methods are defined inside one class like a capsule. Now, the question is why do we need encapsulation? The main reasons are first better control of class attributes and methods. Second, class attributes can be made read only or write only. Third, it makes Java code very flexible. This means the programmer can change one part of the code without affecting other parts. Apart from these, encapsulation is mainly used to protect data and increase security of the code. As you can see to protect the data variables must be private and they can only be accessed through methods. Now let's see Java code for encapsulation to understand the concept better. So now let's create a new project. Next. Next. And I'm going to name it as NCAP 1. So here we have our main class. We can write the code here. So before writing the code, let me create a new class. Right click, new Java class. And I'm going to name it as employee. So in this program we are going to use a classic example of employee using employee name, ID and salary. So in this class, let me create variables. first string name then integer id and then int salary. So I can easily use these variables in our main program by creating object of the class. So let me just create the object employee e is equal to new employee. Now I can use e do ID name or salary anything I need to but this program is about encapsulation. So this is an easy program we can do but in order to secure our programs when we have a large number of program and large number of lines in a program. So we need encapsulation at that time so that data can be secured. So for that I'm going to name it as private. Now all three variables are private so I can't use them. See we can't see them anymore. If I write ID we'll get a red color here. So if we go on it we can see ID has private access. So that means we can't use it directly. Because of this we need getters and setters that are normally methods that are used for these. So right click generate and here you can see getters and setters. So just select all of them and okay. So now we can use these methods instead of direct using the variables. So we can get in the starting then set then get and again set. So likewise it goes like this. So now we have set here. So if I want to declare variable and if I want to put some value inside my variable. So how can I do that? Here you can see get ID or get salary. So if I go for get id sorry if I go for e dot set id and I set it as six. So this shows no error. This means we can use methods to access variables. So let's complete our program now. First I'm going to set everything and lastly e dot Set salary let's get it as 30,000 maybe in dollars or maybe in rupees let's just set it as 30,000 for now. So how I'm going to print it for this I'm going to go to a print statement and then name and e dot not set name but this time I'm going to go with get name. Get name is to return the value of the name that I have given. So in this case that's simply learn and next will be ID and E dot get ID and lastly salary E dot get salary. So this is a simple program that is used to define encapsulation. If we don't use private variables that becomes a normal program. So when we use encapsulation we are going to use private every time whenever we declare variables so that it's secure and no one can access the variables directly. So now let's run the program and there we go we have our result. We have executed the program successfully and as you can see name simply learn ID 6 and salary is 30,000. So I hope you understood the concept of encapsulation. So the main concept of encapsulation is all the variables can be accessed through methods. So for this we use getters and setters that are inbuilt functions for IntelliJ or Net Beans or Eclipse. So with this let's move on to our next program to understand it better and how we can manipulate these variables or methods using program. So again let's create a new project and this time I'm going to name it as encapsulation 2 because it's the second program for encapsulation. And here we have our main program. Now this time I'm going to use an example of cars. So let me just create a new class and I'm going to name it as cars. So in this again I'm going to create three variables that are private. So first I'm going to get string name then private string price that means price of the car and third one top speed of the car. So we can create the program that we did before as it is. But I'm going to explain you more in depth how we can manipulate these variables or classes. So I'm going to create a constructor for the class cars and inside I'm going to give it as arguments as string name then string price and string top speed. And I'm going to give it as this dot name is equal to name. This is so that the class can identify that we are going to give arguments related to that and the class can return the values of it. So similarly I'm going to give it as this dot price is equal to price. And lastly this top speed is equal to top speed. So with this we have completed our constructor for it. Now let's have getters and setters for the same thing for these three variables. So generate getter and setter select all and okay. This is a great feature that we have in Java getters and setters. Otherwise we'll have to type the whole code. So with this let's move on to our main program. We'll write the code here. First I'll create object of the class cars. And inside this I'm going to give arguments or inside this I'm going to give values that I use in constructor to assign the values without using any C do.get name or C do.get price. So my first was name. So let me just name it as BMW. The second thing was price. So I'm going to give it as $30,000. And the third one was top speed. So top speed I'm going to give it as 200 kilometer per hour. So we have assigned all the values to the variables and we have created object as well all in the same line. So this is another way of creating objects or another way of assigning values to the variables that are private. So if I try to print these, they can be easily printed. So in the starting name and C dot so this time I'm going to give get name. So it automatically gets the value that I assigned to the variables through getters and setters. After that price price C dot price get price and in the end top speed C do.get top speed. So if I print this let's execute it. And there we go. We have name BMW price and even the top speed. Now if I give spaces between them it will look neatly. So let me execute it once more. And here you go. Name BMW price $30,000 and top speed 200 km per hour. So this is one of our ways how we can declare variables or assign values to the variables without using any getters or setters. So in this method we used only getters to print the value that we have for variables. Now how can we manipulate the variables if we want to change value of them. Now for this again I can do set top speed or set price. Let the name be as it is. So C dot set price. So price I'm going to set it as $50,000. and C dot set top speed let me increase it to 250 km per hour. So before printing that I'm so that we can differentiate which one is new and which one is old. I'm going to print one more line stats after updation. So now if I print these values I'm just going to copy paste it. So now if I print it, let's execute it. And here you go. First we have name, price and top speed. Then stats after updations. That means after we set the value, the value gets overritten on the variables. And now we have a new price and top speed and all the details. So this is how you can manipulate variables or values inside the variables. >> What is an abstract class? The answer is abstraction is one of the keys to achieving an object-oriented programming approach in designing a software. Here the programmer tries to hide the complicated implementation of the code which makes the software run smoothly. Most of the time the user isn't interested to know how the code is being implemented. So through abstraction we can just hide it. To do so we use an abstract class or sometimes an interface based on the requirement. So abstract class in Java is considered as a template of methods and variables which are used in a program. Remember abstract classes cannot be instantiated directly. Now moving ahead we will next learn the important features of abstract classes. So the first one is template. The main reason programmers prefer to use abstract methods is because they act as a predefined template for any future specific class that you might use. Next, loose coupling is a procedure where an internal object gets the necessary method or a different object from the external world that is other than the current working project. The use of abstract classes makes this process possible. After that, we have the code reusability. Implementation of the abstract classes provides the developers with one of the greatest features that saves time which is none other than the code reusability. Followed by code reusability we have abstraction. As discussed earlier, data abstraction is the process of hiding certain details and showing only essential information to the user. Abstraction can be achieved with either abstract classes or interfaces. Last but not the least, dynamic method resolution. The abstract classes enable us with dynamic method resolution or the dynamic method dispatch process. The dynamic method resolution is a mechanism by which a call to an overridden method is resolved at runtime. This is how Java implements runtime polymorphism. When an overridden method is called by reference, Java determines which version of that method to execute based on the type of object it refers to. Now these were the few important features of abstract classes. Next in the docket is the crucial rules to be followed to use abstract classes. All right, let us go through the rules one by one as mentioned below. The first one is the keyword abstract is mandatory to declare an abstract clause. Followed by that, the next rule says that abstract clauses cannot be instantiated directly. The third one is an abstract class must have at least one abstract method. Next to that we have another rule which says an abstract class includes final methods. Next, an abstract class may also include non-abstract methods. It's not mandatory that an abstract class should only include abstract methods. So, the last rule says that an abstract class can include constructors and static methods. So, these were some crucial rules to be followed to use abstract classes in Java. So far we have discussed the definition of abstract classes, its features and the rules to use abstract classes in Java. Now we will learn how to achieve abstraction in Java. So basically there are two different ways to achieve abstraction in Java. The first way is by using abstract classes and the next one is by using an interface. Now this brings us to our next topic that is the syntax to be followed to use an abstract class and an abstract method. To declare an abstract class, we use the keyword called abstract followed by that we use the keyword called class. Then after that we declare the name of our class. The name of the class is up to the user's choice. For example, I have named my class as simply learn as shown here. Followed by the abstract class, we have the abstract method. To declare an abstract method, we use the keyword called abstract. Then the written type of the method. As of now, I have used void. Then later, we have the name of the method that is based on the user's choice. As you can see, I have used simply learn as the name of the method. So this was by using abstract class method. The next one is by using an interface method. Now what exactly is an interface? So interface can be defined as a boundary between the method and the class implementing it. In Java, we use interface to achieve abstraction. In other words, we can also consider interface as a container which saves the signatures of the methods used in a program. Now we will move ahead and understand the syntax to use an interface to achieve abstraction in Java. To declare an interface, we use the keyword called interface followed by that we declare the name of a class. The class name is up to the user's choice. For example, I have named my class as simply learn as shown below. As discussed earlier, interface acts just as a container that stores only the signatures of the method. We cannot have a complete method defined inside it. All we can do is just declare an interface. Now that we have a detailed explanation about the abstract class and the interface, let us look into some example programs based on abstract classes. Now we have successfully booted the Eclipse IDE. Now let's create a new project. So to create a new project just click on create a project and this should give you a dialogue box wherein you have to select Java project. Click next. Now let us give a name to our project. So simply learn will be the name of my project here. Now let me click on finish to finish this process. As you can see the project has been successfully created. And inside the project simply learn we have the source file and right clicking the source file will give us a dropbox where you can just select new and inside new you can select a new package. Now let's name the package as abstraction and click on finish to create the package. Moving further let's right click on the package and select new and from new select a class to create a new class. So the name of my class will be employee. Let's click on finish to create the class. Now we have our employee class ready. Now let's right click on the package and select new. And inside that let us select another class. And the name of this particular class will be person which will act as our abstract class. So as you can see we have declared this particular class with the keyword abstract and the name of the class is person. So our first example which is based on employees where we will have an abstract class called person and this person class will be inherited by the employee class and gets executed to generate employee details. Now let us try to execute this program and see the output. To execute the program, just right click on the package and go to the run option and select the first one that is Java application. Now you can see we have the employee named Pavetra and the gender is female and the employee has logged in successfully. So these are the details which we were expecting to be presented on the output console. Now moving ahead we shall execute our next example which will be based on students. So here the class student is the abstract class and three different student classes namely Raju, Pranita and Punit will inherit the student class and generate the output that displays their particular ranks. So you can see our abstract class that is student is been declared using the keyword abstract and inside that we have an abstract method which is get rank and these classes that are Raju, Pranita and Punit will inherit the abstract class student and display their ranks. Now let us try to execute this program and see the output. As you can see the three classes have successfully inherited the abstract class and displayed their ranks on the output console. Now let us move ahead and try to execute one last example based on abstract classes. So the third and last example is based on interest rates provided by different banks. Here we have an abstract class named loan and all the banks described in the program will inherit the loan abstract class to calculate the rate of interest on the loans provided by them. As you can see we have the abstract class that is loan and inside that we have the abstract method which is interest. So we have the classes Andra Bank, Bank of Boda, IDBC bank, State Bank of India which are inheriting the abstract class called loan and the method interest to display their rates of interest. Now let us try to execute this program and see the output. As you can see the program got successfully executed and the rate of interest for loans from different banks has been displayed in the output console. So with this we have entered into our next topic where we understand the differences between an abstract class and an interface. So the first difference between the both is the keyword. While we declare an interface we use the keyword called interface. On the other hand when we declare an abstract class we use the keyword abstract. followed by that. The second difference is when you use an interface, the subclasses basically implement an interface. While on the other hand, when you use abstract classes, the subclasses extend an abstract class and inherit the properties of the abstract class. Followed by that, the third difference is multiple interfaces can be implemented. But on the other hand, only one abstract class can be extended at one particular instance. And the final difference between the both is interface is capable to support multiple inheritance. Whereas on the other hand, abstract classes are not capable to support multiple inheritances. Multiple inheritance is none other than the diamond problem which is not supported in Java. Now that we have understood the differences between the both, let us understand the major advantages and disadvantages of using an abstract class. Now first we will discuss the advantages. So the advantages of using an abstract class in Java are the abstract classes are highly beneficial in writing shorter codes. The abstract classes avoid code duplication. They enable code reusability which is a major advantage. And finally the last advantage is changes to the internal code implementation can be done without affecting the classes. So these were few of the major advantages of using an abstract class. Now moving ahead we shall discuss the disadvantages of using abstract classes. Few of the disadvantages of using an abstract class in Java are abstraction is expensive as sometimes you need to handle cases and situations which are not necessary. Followed by that the second disadvantage is object relational impedance must match in the case of RDBMS and the last disadvantage is object relational mapping in case of frameworks like hibernate. So these are the few important disadvantages of using abstract classes in Java that you need to consider before using them into your project. What is inheritance? There are two other key terms which are not going to be in this agenda but you should also uh when you get to them make sure you bundle them together as you're understanding these structures and that's the abstract class and the polymorphism. So what is inheritance? Inheritance is an act through which a new class gets created by acquiring the variables and methods defined in the previous parent class. So we look at what is inheritance. We can take an example of say uh food. We have veggies, noodles, fruits uh where food is the parent and your veggies, your noodles and fruits are all subclasses of that. They're all kind of children of food. Why do we need inheritance? We implement inheritance for a multiple of reasons like creating a possibility to add or remove features to reduce the code length as we reuse the code uh more comfortable to develop and maintain the project. And so, uh, if we start looking at, let's say we have a cell phone, we make calls, we have our SMS texting, our communication on our phone, we have our media, we also add a browser on there. Now, we have a smartphone. And we look at that, we have our phone setup. And then we have our um, full smartphone, media, call, SMS, and browser. And we start to kind of link these. Instead of making them separate, we can have the call and the text. And then we can have them inherit uh we can actually create a media that inherits their quality. So now you can text your media. Now you can use the browser as part of your call scenario. And I would even add one more example in here and that is that all programming languages that are object-based are built on inheritance. Uh Java, Python, C++. So this concept of building an object and then that object then is inherited by everything underneath of it is important to understand even in these most uh even as we're looking at more specific cases. So we'll take a look at the components of inheritance and the most important uh two components in inheritance. The two major components that are mentioned are parent class or the superass and the child class or the subclass. And to see this, let's go ahead and um jump into Eclipse and take a look at what the actual code looks like. So the first thing I want to do is go ahead and add in a new package. And we're going to go ahead and call this package um inheritance because that's what we're working with. Oops. gave me a default Java tutorial in there. Inheritance finish. And I I started off with the Java tutorials just a um went in and created a new project and made sure it was Java based. So we have our package um inheritance right here. We're going to go ahead and add in a new class and we'll go ahead and call this class machine. Now one of the standards when you're creating classes to capitalize the first letter. So, always remember to do that. Uh, in some places, people like to have the whole word capitalized. It really depends on who you're working with. Uh, but it is kind of if it starts with a capital letter, it's probably a class. And so, once we have our inheritance, we have our public class machine, let's go ahead and give it a little bit underneath there to do something. And we'll start with um uh protected string brand. And so whatever machine we're working with uh these particular machines are going to be um we'll call them s it'll be a Samsung free uh they get some free vocab free marketing right there for Samsung. Uh so Samsung machines and then we want it to do something. So let's go ahead and put a procedure in there. I'll make it public void because it's not going to return anything. And we'll call this um wash. I guess they're all wash machines. There we go. There's our brackets. A little trouble finding the bracket on there. And let's just have it uh during this, we'll just have it do a quick uh print line. and we'll say um initiating cycle there and then of course our semicolon on the end. All right. So now we have a public class machine and we're going to get into where we start working with the actual inheritance. You can create an object with this machine. We haven't done anything special to it. It's uh like any other class you might create in the Java language. And we've added in public uh void wash a procedure with no return. That's what the void means. And it's going to print out. And so let's go ahead and create another um class in here. New class. And this one's going to be washing machine. Washing machine. And we'll go ahead and hit finish on here. And we come into our washing machine. This opened up a nice new tab for us. And we might have a private uh string model name. We'll change this to model type. Model type equals. So the type of machine is is a topload washing machine. So we have a Samsung is the main type of machines we're looking at and we have top loader or a toploading washing machine. And then we're going to add up here extends machine. And so this is the the key code we're going to look for because um we want this to have the properties of the machine. Uh so this comes in and says whatever is in machine we now also have in our washing machine. And then of course if we're going to do all this we need to actually be able to run it. And if we're going to do that, we want to go ahead and add in the public static void main reserved um keywords there. And this is just your standard main uh startup. You have your string of arguments. There we go. And of course, our bracket. And then in here, we're going to take and create a washing machine object. And so here's our wash machine. It's of course the type washing machine and it's going to equal a new washing machine. So we're initiating a new object in here. There we go. Uh and then we want it to do something. And if we're going to have it do something, we want it to go ahead. Um let's see what happens when we have wash. Remember our keyword up there was washing machine dot uh wash. And where did that come from? Well, if we go back into machine, here it is. Public void wash. There's the procedure and it's coming into the washing machine and this is inherited. Uh that way we don't have to retype that every time we have a washing machine. This could be washing machine. Uh maybe the next one is I don't know different kind of washing machines. I'm not an expert on washing machines. We have it do a wash and then specific to the washing machine in here. We also had uh the type and so we can come back up here or brand. So we can come up down here. We can go uh system uh dot print line wash machine dot brand plus put a little dash in there. um plus and then we're going to go ahead and we have our wash machine dot model type. That model type we put in there. Uh so the brand, where does the brand come from? The brand's coming from our machine. We have our protected string which is going to be Samsung. And then we have our washing machine which has the model type which is a top load machine. And if we go ahead and run this after, of course, we make sure we have that semicolon in on the end there. We come up there, we'll see initiating cycle. Initiating cycle is printed out from machine. And then the Samsung top load washing machine is the second printout line here. And so when we have our wash print out here also the wash machine wash is initiating cycle and then we have that's where that printout comes from. We can go back up here to machine. You can see right here initiating cycle and then we flip back over to the washing machine. We print out wash.brand which is the machine class and then wash machine type which is underneath the washing machine. So let's go over all that. Let's take a look and see what we're talking about here. So we saw in the code the extends keyword. The term extends is a predefined keyword in Java that allows you to create a new child class by deriving the variables and methods from the parent class to reduce code length and improve the performance. And we see that right up here in our public class washing machine extends machine. So, the next key thing to talk about is access modifiers. And I kind of breezed over them when I put together the code, but we'll dig in there a little deeper. We talk about access modifiers. There's four different words you really need to know. And that's default, public, protected, and private. And I'm going to tell you right now, default equals public. So, what is default? Default access modifier is set implicitly whenever you declare a class without a specific access modifier. By default, the access of a class or method when declared without a specific access modifier becomes available to any other method or class within the same package. And in Java, the default is public. Uh so public a certain class can be declared as public by using the keyword public. Any class or method when declared as public becomes available to any class or method declared in the same package. But if a different method or class needs it, it should be imported. And then we have protected. A certain class is declared protected by using the keyword protected. This provides access to the methods and variables of the protected class only to the rightful subclasses and protects the data from any other classes which are not related. And then private. A certain class is declared protected by using the keyword private. This provides the ultimate protection to the data members and the methods of the private class. This procedure is implemented by class to encapsulate the method and members. So uh we'll take a a little we're actually going to do a different example in here. But I do like this underneath the uh washing machine. You can see right here we have put in private a private string. What this means is that only washing machine can access that private string. Uh where if you have protected the children can access it. Uh so a protected screen if you're underneath a machine up here we have protected. So that when I create the washing machine and extend machine um I can still access it. But if I create a subclass of washing machine and I mark it as private, that subclass is not going to be able to access it. And so it has to do with what layers of accessing. Think of this as a big team project. You create something. Do you really want that to cascade down to the next class or who do you want to have access to that? Let's go a little deeper to really bring this home because it's really important to understand this terminology. Uh let's go ahead and start a new class here. And we're just going to call this particular class um summation and go ahead and create that. Finish. And so our summation class is going to be uh pretty simple in here. Uh we'll go ahead and do uh public so anythingbody can access it. Remember here's our public on there. And then we'll just do a um integer because that's what it's going to return as an integer. We're going to call it add and we're going to put integer x comma integer y and and we'll just return x + y. So real simple, we're just adding two numbers. Here's our two inputs. They're both have to be integers and we're going to return an integer and it'll be the summation of the two. So real simple class right there. And if we're going to have a summation, then let's go ahead and create a new class. We'll call this one child. And in our new child class, we're going to go ahead and keep this simple. And we're just going to have our public static main uh we're going to have our summation a equals new summation. And then system out print line aadd 100 plus 200. Pretty straightforward. Everything's public in here. Um, oops. Okay, there's our running. And we see that answer is 300. So this is public. If you remember correctly, we're talking about public. And so when we use the public keyword, any class or method when declared as public becomes available to any class or method declared in the same package. Uh, but if in a different method or class needs it, it should be imported. So here we go. That's our public setup. It's just open to everybody. Well, everybody that's under the package inheritance. So what whoever is using that package can now use the this particular child. And let's go ahead and add a new class in. And this time we're going to do a parent class. We'll just put that right in there. And we come in with our parent class. You can see right here the parent class itself is public. But what we want to do underneath the parent class is we want to create a protected uh void because we're not returning anything and print. So we're going to do the print there. And this protected print, let's go and put our brackets in there. And we'll do just a simple uh print line hello world. And once we have that uh print hello world, we want to go ahead and add a child class to this. And let's see, we already well, we had the child class when it took it out a second ago. So, we'll go ahead and put that back in. Uh, here's our child class. And for this child class, we want it to go ahead and extend the parent. Uh, so inheritance, there's our extend on there. Oops. Retype that. All right. Extends parent. So, now the child class is part of the parent class. And we'll go ahead and put our main in there so that it will run it and execute it. And we'll create our child x equals new child class. We go ahead and assign our um variable x and initiate it. And then we'll do just the print and see what happens here. So here's our print statement. And we'll go ahead and run this and compile our child on there. And when it comes in there, you see it says print hello world. And so the parent has marked this as protected. So it's protected from um objects that are not inheriting it. But the child can still access that information and print it on there. So here's protected. This provides access to methods and variables of the protected class only to the rightful subclasses and protects the data from any other classes which are not related. In a lot of programming, that's usually where you end up is doing a lot of stuff that is um underneath your parent that is protected. You either make them public or protected. A lot of people are sloppy and just make them public, but most of the stuff you want to make sure it's uh protected. And then we finally have our private. And I'm going to go back here to um our child and we're going to run this. And it's going to come up and say uh proceed with launch errors in setup. And then it's going to give us an exception thread main compilation error. The method print from the type parent is not visible. And that's because unless you actually initiate the parent, you're not going to see this code because it's private. It's only private to the public to the parent class. So even if I extend it in child, it will not be available. And that again protects it. That means it's something that you don't want to inherit and cascade down because maybe it is a piece of code that is going to be changed. So you don't want all the children to crash every time you make a change to it. So with private this provides the ultimate protection to the data members in the methods of the private class. This procedure is implemented by class to encapsulate the methods and members. So very important we have private and we have protected and we have public. The more access you want other pieces of the software code to have and other programmers to have the more public you want to make it. And of course the default is public. Now one of the common workarounds for this because you have protected data but you still want it to be used by the subasses is to create what they call like a get or a um and we'll do it up here. We'll go ahead and do a uh private integer x= 5. And then instead of on your inheritance, instead of having it uh call it from the child, we might have a get thing or a get a get thing. We might have a public. It's going to return an integer and we might have it say get x. And this simply just return x. And what this means is that uh we have something simple like this where it just does a return x. I can go back into my child here and instead of print x, we'll do um x dot getx. And we'll go ahead and print this out or you know something simple with that. We'll go ahead and do a uh system print line on this. And when we run this, you'll see it come up. It's going to recompile and we get our five. What's happening here is now I've created underneath the parent private information. You don't know what's going on with it. It's protected. Uh you might have a procedure that's protected. In this case, we had the print procedure. And then we access it from the public. And this could have easily have been instead of um maybe we'll just call it uh public void public public print kind of a a goofy way of doing the code. There we go. And then it could go in here and access our um print. And so we can actually still access this print variable up here by wrapping it in kind of a get or a public function. This allows us to protect whatever code is going on in the parent class. So it can't be messed up. It can't be accessed indirectly. It has to go through the right processes. And so when we get to the child on here, the child can then still has the public processes, but all the other information isn't is protected and is private. It's really important to remember that private right there. This brings us to super keyword and we talk about the super keyword. Uh super keyword eliminates the confusion between parent class method and subclass method. Super keyword is implemented to access a method or constructor that is defined in the parent class. So, back in Eclipse, we'll go under parent and we'll take this. We're going to take the private out of there. So, now we have an integer five. And we'll go ahead and just remove the print because we're not going to do that in the parent. Um, oops. And the public. There we go. And so, let's create a parent that just has one piece of information. It has an integer x equals 5. And then we're going to go to the child and let's go ahead and add in here integer x= 10. And these are by default they're public. We haven't set anything on here uh telling it what it is. And so what I'd like to do is we'd like to go ahead and create a oops one more thing. There we go. Create a procedure here. And we'll just call this void capital print. It's just going to be a system out print line. And this is what I want you to notice is we're going to print out x and super x. Uh so we have the child class x and we have the parent class super x. And if we um come down here and we do x um print, don't forget my semicolon. add a couple spaces in here to make it uh look nicer when we print it. And we'll go ahead and run this. And you can see that the child class prints 10 and the parent class is five. And so this way you can actually store different information depending on what it is you're working on and what you're doing. And that's where this super comes in. You can see right here where the super underneath the class and the print module. Uh now you can't just put it in down here under print. and we can explore what that looks like. If I just take this and I go ahead and highlight it and let's say I wanted to just instead of doing xrint, uh, it's going to come up right here. And right off the bat, you see the super.x, I could do x.s super.x, and it's still going to give me an error right here. It has to be underneath a procedure in the actual class and not under the main. This brings us to types of inheritance. And there's four main types. Uh, we have single inheritance, which we've already pretty much looked at, but we'll go back over. We have multi-level inheritance. We have hierarchial inheritance and hybrid inheritance. Let's go ahead and just start with the single inheritance. Single inheritance consists of one parent class and one child class. Here, child class inherits parent class methods and data members. And let's go ahead and create a a new class up here just to change it up and keep it interesting. new class and we'll call this one student uh and under the student and we'll have a a simple setup. We'll just do an enrolled and it'll say uh enrolled in SimplyLearn. There we go. So there's our uh class student and then we'll create another class uh we'll do it as um because we have our student our base student and then we'll call this one new class and we'll call this one uh computers. There we go. So he's a rolled finish. And for computers, let's go ahead and put in a uh print line here. And we'll put down studying computers and we want to go ahead and do the extends extends student. So it's a student studying computers subclass computers. And this should all look familiar because we've been doing this for, you know, a lot of the other setups. This is your basic inheritance. Um, and we'll change that from enrolled to studies. And then let's go ahead and put a main in here so we can actually run it. And we have our P enrolled, which comes from our uh parent class, and our P studies, which comes from the child or the um one inheritance at the extends for student. And let's go ahead and run that. There we go. Run. And you can say enrolled in simply learn studying computers. And then we can go on to the next setup. And this is where we look at multilevel inheritance. There's also a parent child inheritance relation. But the difference is the child class is inherited by another child class. This is the basic structure of most programming languages. Right here you have an object. you have all the different things under the object and it gets all the way down to whether it's an array you're working with, whether even a class is a subchild that goes all the way up to the object. And we can simply do that in our code in Eclipse. And we'll just go ahead and add a new class in there. We'll call this one uh Java. There we go. Oops. Java. And under Java, we want to go ahead and oh create some of the similar stuff. And then I want to go back to my student. I took out the main and student just because I don't want it to run the main in there. And in here we're going to have system out um we're going to have instead of studying computers focus on Java, which is what we're doing right now. And maybe we'll call this classroom. And then we can come down here and we have our P equals new computers. Well, instead of new computers, we want our Java and it's going to be a Java object. And we need to put our extends in up here extends. In this case, we came from uh computers. So there's our initial thing. And then we have our last print in here. And of course if we run this now we'll see that it should if I did everything correctly come up and say enrolled in simply learn studying computers focus on Java and we have the enrolled which is the parent to computers and then we have under computers well we have student then computers and then Java and so each one of these classes just cascades all the way down and this is your multi-level uh from your class A to class B to class B and if you can have multi-level inheritance we can also have a hierarchial inheritance where your parent child relationship the only difference is here multiple child classes inherit from one parent class and that is pretty uh um we'll do another class here um if you remember correctly we had uh student computers uh maybe from student we'll have uh instead of computers we'll have project management uh project management. So you're studying your idle and um all your other classes in there for cascade and for um uh doing agile programming. And in here we can do that. It's just the same as we did before. We just have a second child coming in from here. And so this would go ahead and extend extends extends student. And of course, whatever uh subcategory you have one in here for running this. And so for here, we'd have like our void studies. In this case, instead of studying computers, uh we're studying project management. Project management. One of the other wonderful classes that is taught from the SimplyLearn team. And we'll go and run that. And you can see right here we have uh computers. Oops. Of course, uh, instead of computers, I meant to do project management. There we go. And we have to also initiate it as a new. And then when we run here, we can see this uh we're enrolled in SimplyLearn and we're studying project management. And then finally there is the um the hybrid. The name itself explains it to us. Uh the hybrid inheritance can be a combination of any of the three types of inheritance supported in Java. And so maybe we already saw that because we have um our A and our B. If we flip back on over to um our Eclipse, we have our student. Our student now has a computers project management. So there's our um hierarchial and then they're mixed because we also have the Java which is an extension of the computer and so we have multiple layers there. So one of the issues that comes up with inheritance in classes is what they call the diamond problem. And in the diamond problem the Java programming language does not support multiple inheritance as it ends up with serious ambiguity. And that is where we have D which inherits from both B and C which might both inherit from A. Uh this is the diamond factor because as you start tracking your supers going up which one are you actually looking at B or C or A? Uh and that's why they call this a diamond problem. It comes up more than you would think. You get very complicated structures and you realize, oh, I need to have both sets of instructions come down to whatever I'm working on. And you can see where that can become a problem. Let us take a look at is a relation and has a relation. Now these I mean they're vocabulary but they're more of a concept understanding how things fit together. And so when we talk about is a relation when a class inherits methods and members from a different class then the relationship is said to be is a relation. examples. Orange is a fruit. And oh, let's just jump back on over here and we'll make a new class. And we'll call this class customer. So, we're going to have our customers. Oops, there we go. If I can remember how to type. So, we have a class customer. And I've gone ahead and and our team in the back went ahead and prepped this for us. Um, let's just take a quick look though. We got public string name. So, it's accessed uh publicly. If you leave this out, it'll automatically be public because that's the default. And then we have our customer and the string, which is a name, and a string is a city. And then when you do a customer and you send it the name and the city, it will do this name equals name and this city equals city. We could have easily done this private. We have a call into it to create it. Uh, so it wouldn't really matter too much whether we did it private or uh public. I would actually be more likely to do it private. And for this um example, we'll go ahead and create a another class and we'll call this store. We'll have our store class. So we have customers and we have a store. Um and then we'll go ahead and uh set up in here. And this time we did do a private. We're going to create a list of customers and then the store list coming down and then this customer customers and public list customers. A quick look at this is we did make this one private. Uh which is nice because now it can't be accessed externally except from store. Uh and then store has the public list customers. So we can send it a list of customers and then it go ahead and returns the customers from that list. And then when we add it to the store, it sets the customers in the store. This customers equals customers. One of the reasons we have the error lines in here is I haven't compiled it. so it doesn't see the customers are part of our package. And we'll get to that in just a moment here. And then let's go ahead and create another class. Uh we'll call this is a relation since that's what we're working on. And here's our is a relation setup. And we're just going to put this as the main. So you have your main in there. Um and then we went ahead and prepared um a series of customers. and we'll just call it uh customer C1 equals a new customer. Customer C2 equals a new customer. And we're just creating a list here. That's all we're doing. And if we're going to have a list, then we need to go ahead and uh create a list of customers. And um we'll just do that with a simple list setup. And then we got to add those customers into the list. So let's go ahead and do that. So breaking this down we have a customer uh one which is Raju Bangalore uh Shiva Hyperbad um Sachin Mumbai and so on and then we just created a list of customers a new array of lists and we add in each of those customers. So now we have a nice uh list of all our different customers in here. And then we want to go ahead and uh create our um uh store and we'll put in store and it'll be a fruit smoothies franchise. I put down fruit smoothies French. Um maybe that's not a good abbreviation. You might think it's a French instead of franchise. Uh there'll be a new store. Um, and then we have our new store, which is um, in this case, we're going to put in that new store customers. And if you remember, we went back here into store. Let me just flip back on over there. It's going to tak
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Simplilearn · Simplilearn · 0 of 60

← Previous Next →
1 Ethical Hacking Full Course 2026 | Ethical Hacking Course for Beginners | Simplilearn
Ethical Hacking Full Course 2026 | Ethical Hacking Course for Beginners | Simplilearn
Simplilearn
2 AWS Full Course 2026 | AWS Cloud Computing Tutorial for Beginners | AWS Training | Simplilearn
AWS Full Course 2026 | AWS Cloud Computing Tutorial for Beginners | AWS Training | Simplilearn
Simplilearn
3 Data Structures And Algorithms Full Course | Data Structures and Algorithms Tutorial | Simplilearn
Data Structures And Algorithms Full Course | Data Structures and Algorithms Tutorial | Simplilearn
Simplilearn
4 SQL Full Course 2026 | SQL Tutorial for Beginners | SQL Beginner to Advanced Training | Simplilearn
SQL Full Course 2026 | SQL Tutorial for Beginners | SQL Beginner to Advanced Training | Simplilearn
Simplilearn
5 Microsoft Azure Full Course 2026  | Azure Tutorial for Beginners | Azure Training | Simplilearn
Microsoft Azure Full Course 2026 | Azure Tutorial for Beginners | Azure Training | Simplilearn
Simplilearn
6 Shopify Tutorial For Beginners 2026 | Shopify Course | shopify dropshipping | Simplilearn
Shopify Tutorial For Beginners 2026 | Shopify Course | shopify dropshipping | Simplilearn
Simplilearn
7 Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Simplilearn
8 🔥Feeling Stuck? How Upskilling Can Boost Your Career! #shorts #simplilearn
🔥Feeling Stuck? How Upskilling Can Boost Your Career! #shorts #simplilearn
Simplilearn
9 Growth Hacking In Marketing | Learn Growth Hacking Marketing Strategies | Simplilearn
Growth Hacking In Marketing | Learn Growth Hacking Marketing Strategies | Simplilearn
Simplilearn
10 🔥Cracked 3 Job Offers with One AIML Course! | 20–30% Salary Hike #shorts #simplilearn
🔥Cracked 3 Job Offers with One AIML Course! | 20–30% Salary Hike #shorts #simplilearn
Simplilearn
11 Top 10 Must-Have Figma Plugins for UI/UX Designers in 2026 | Figma Plugins | Simplilearn
Top 10 Must-Have Figma Plugins for UI/UX Designers in 2026 | Figma Plugins | Simplilearn
Simplilearn
12 Business Analytics Full Course 2026 | Business Analytics Tutorial For Beginners | Simplilearn
Business Analytics Full Course 2026 | Business Analytics Tutorial For Beginners | Simplilearn
Simplilearn
13 Simplilearn Reviews | Getting future-ready with course in Artificial Intelligence | Roopam’s story
Simplilearn Reviews | Getting future-ready with course in Artificial Intelligence | Roopam’s story
Simplilearn
14 Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
15 Full Stack Developer Course 2026 | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Full Stack Developer Course 2026 | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Simplilearn
16 Simplilearn Reviews | How David Went From Seasoned Engineer to AI Innovator #GetCertifiedGetAhead
Simplilearn Reviews | How David Went From Seasoned Engineer to AI Innovator #GetCertifiedGetAhead
Simplilearn
17 Complete Social Media Marketing Strategy for 2026 | Social Media Marketing Strategy | Simplilearn
Complete Social Media Marketing Strategy for 2026 | Social Media Marketing Strategy | Simplilearn
Simplilearn
18 🔥Top 4 Cybersecurity Certifications You Need! #simplilearn #shorts
🔥Top 4 Cybersecurity Certifications You Need! #simplilearn #shorts
Simplilearn
19 🔥Cloud Engineer Salary in India 2026 | City-Wise Breakdown #shorts #simplilearn
🔥Cloud Engineer Salary in India 2026 | City-Wise Breakdown #shorts #simplilearn
Simplilearn
20 Digital Marketing Full Course 2026 | Digital Marketing Tutorial For Beginners | Simplilearn
Digital Marketing Full Course 2026 | Digital Marketing Tutorial For Beginners | Simplilearn
Simplilearn
21 Full Stack Java Developer Course | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Full Stack Java Developer Course | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Simplilearn
22 Social Media Marketing Full Course | Social Media Marketing Tutorial For Beginners | Simplilearn
Social Media Marketing Full Course | Social Media Marketing Tutorial For Beginners | Simplilearn
Simplilearn
23 How To Create LLM Chatbot Demo 2026 | Build a LLM Chatbot From Scratch | Simplilearn
How To Create LLM Chatbot Demo 2026 | Build a LLM Chatbot From Scratch | Simplilearn
Simplilearn
24 Digital Supply Chain Management Certification | Supply Chain Management Course | Simplilearn
Digital Supply Chain Management Certification | Supply Chain Management Course | Simplilearn
Simplilearn
25 AI Agents Full Course 2026 | AI Agents Tutorial for Beginners | How to Build AI Agents | Simplilearn
AI Agents Full Course 2026 | AI Agents Tutorial for Beginners | How to Build AI Agents | Simplilearn
Simplilearn
26 ITIL Full Course 2026 | ITIL 4 Foundation Course | ITIL Tutorial For Beginners | Simplilearn
ITIL Full Course 2026 | ITIL 4 Foundation Course | ITIL Tutorial For Beginners | Simplilearn
Simplilearn
27 Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
28 ITIL Full Course 2026 | ITIL 4 Foundation Course | ITIL Tutorial For Beginners | Simplilearn
ITIL Full Course 2026 | ITIL 4 Foundation Course | ITIL Tutorial For Beginners | Simplilearn
Simplilearn
29 Simplilearn Reviews | Integrating AI & Music | Diego's Story
Simplilearn Reviews | Integrating AI & Music | Diego's Story
Simplilearn
30 Digital Marketing Full Course 2026 | Digital Marketing Tutorial For Beginners | Simplilearn
Digital Marketing Full Course 2026 | Digital Marketing Tutorial For Beginners | Simplilearn
Simplilearn
31 SEO Full Course 2026 | SEO Tutorial for Beginners | SEO Training | SEO Explained | Simplilearn
SEO Full Course 2026 | SEO Tutorial for Beginners | SEO Training | SEO Explained | Simplilearn
Simplilearn
32 PMP Vs CAPM: Which Certification Should You Choose? | PMP Vs CAPM | Simplilearn
PMP Vs CAPM: Which Certification Should You Choose? | PMP Vs CAPM | Simplilearn
Simplilearn
33 Complete Data Analyst Roadmap 2026 | How To Become A Data Analayst In 2026 | Simplilearn
Complete Data Analyst Roadmap 2026 | How To Become A Data Analayst In 2026 | Simplilearn
Simplilearn
34 Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
35 🔥5 Jobs That Are Most Likely Safe from Layoffs in Today’s Market #shorts #simplilearn
🔥5 Jobs That Are Most Likely Safe from Layoffs in Today’s Market #shorts #simplilearn
Simplilearn
36 🔥Git vs GitHub – What's the Difference?
🔥Git vs GitHub – What's the Difference?
Simplilearn
37 What Goes Behind Building the Likes of Uber and Netflix? | Product Management Tutorial | Simplilearn
What Goes Behind Building the Likes of Uber and Netflix? | Product Management Tutorial | Simplilearn
Simplilearn
38 AI Agents Full Course 2026 | AI Agents Tutorial for Beginners | How to Build AI Agents | Simplilearn
AI Agents Full Course 2026 | AI Agents Tutorial for Beginners | How to Build AI Agents | Simplilearn
Simplilearn
39 Full Stack Developer Course 2026 | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Full Stack Developer Course 2026 | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Simplilearn
40 Product Life Cycle 2025 | Stages Of Product Life Cycle | Product Life Cycle Tutorial | Simplilearn
Product Life Cycle 2025 | Stages Of Product Life Cycle | Product Life Cycle Tutorial | Simplilearn
Simplilearn
41 Project Management Full Course 2026 | Project Management Tutorial | PMP Course | Simplilearn
Project Management Full Course 2026 | Project Management Tutorial | PMP Course | Simplilearn
Simplilearn
42 PCB Design Course 2025 | PCB Designing Explained | How To Make PCBs | Simplilearn
PCB Design Course 2025 | PCB Designing Explained | How To Make PCBs | Simplilearn
Simplilearn
43 Python Full Course 2026 | Python Data Analytics Tutorial For Beginners | Simplilearn
Python Full Course 2026 | Python Data Analytics Tutorial For Beginners | Simplilearn
Simplilearn
44 🔥Top Product Management Skills You Need to Succeed in 2026 #shorts #simplilearn
🔥Top Product Management Skills You Need to Succeed in 2026 #shorts #simplilearn
Simplilearn
45 SQL For Data Analytics 2026 | Essential SQL Commands | SQL Tutorial For Beginners | Simplilearn
SQL For Data Analytics 2026 | Essential SQL Commands | SQL Tutorial For Beginners | Simplilearn
Simplilearn
46 Simplilearn Reviews | Paving Way To Success With AI & ML Course | Soumik’s Upskilling Journey
Simplilearn Reviews | Paving Way To Success With AI & ML Course | Soumik’s Upskilling Journey
Simplilearn
47 Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Simplilearn
48 Learn Snowflake In 45 Mins | Snowflake Tutorial | What Is Snowflake | Snowflake Explained
Learn Snowflake In 45 Mins | Snowflake Tutorial | What Is Snowflake | Snowflake Explained
Simplilearn
49 🔥ML Career Tip – How to Start Learning Machine Learning in 60 Seconds! #shorts#simplilearn
🔥ML Career Tip – How to Start Learning Machine Learning in 60 Seconds! #shorts#simplilearn
Simplilearn
50 🔥Agile vs Waterfall in 60 Seconds #shorts #simplilearn
🔥Agile vs Waterfall in 60 Seconds #shorts #simplilearn
Simplilearn
51 Excel Full Course 2026 | Excel Tutorial For Beginners | Microsoft Excel Course | Simplilearn
Excel Full Course 2026 | Excel Tutorial For Beginners | Microsoft Excel Course | Simplilearn
Simplilearn
52 What Are AI Agents? | Types Of AI Agents | AI Agents Explained | AI Agents Tutorial | Simplilearn
What Are AI Agents? | Types Of AI Agents | AI Agents Explained | AI Agents Tutorial | Simplilearn
Simplilearn
53 How To Create a Product Roadmap In 2026 | Product Roadmap | What Is Product Roadmap | Simplilearn
How To Create a Product Roadmap In 2026 | Product Roadmap | What Is Product Roadmap | Simplilearn
Simplilearn
54 SQL Full Course 2026 | SQL Tutorial for Beginners | SQL Beginner to Advanced Training | Simplilearn
SQL Full Course 2026 | SQL Tutorial for Beginners | SQL Beginner to Advanced Training | Simplilearn
Simplilearn
55 🔥What Is Phishing? #shorts #simplilearn
🔥What Is Phishing? #shorts #simplilearn
Simplilearn
56 Cloud Computing Full Course 2026 | Cloud Computing Tutorial | Cloud Computing Course | Simplilearn
Cloud Computing Full Course 2026 | Cloud Computing Tutorial | Cloud Computing Course | Simplilearn
Simplilearn
57 Simplilearn Reviews | Overcoming Rejection & career plateau to finding a New Job : Bhaskar Banerji
Simplilearn Reviews | Overcoming Rejection & career plateau to finding a New Job : Bhaskar Banerji
Simplilearn
58 Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Simplilearn
59 Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
60 VLSI Design Course 2026 | VLSI Tutorial For Beginners | VLSI Physical Design | Simplilearn
VLSI Design Course 2026 | VLSI Tutorial For Beginners | VLSI Physical Design | Simplilearn
Simplilearn

Related AI Lessons

Chapters (6)

Introduction to Java Full Course 2026
2:28 Object Oriented Programming in Java - (OOPS Principles in Java)
7:28 What is Java?
12:31 How to Install Java on Windows
23:41 What is an Algorithm
35:16 Java Tutorial Loops
Up next
This Cop Was Held Accountable For His Brutality! #police #lawyer
Hampton Law
Watch →