Introduction to Java Programming | John Thompson | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Introduction to Java Programming

teacher avatar John Thompson

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

20 Lessons (3h 18m)
    • 1. Java Programming Course Introduction

      1:54
    • 2. Meet Your Instructor

      4:38
    • 3. Why Learn Java

      3:27
    • 4. Introduction To Java Programming

      9:13
    • 5. What Is Needed To Program Java?

      5:09
    • 6. Install Java 11 Windows 10

      18:12
    • 7. Install Java 11 on MacOs

      14:35
    • 8. Install Java 11 Ubuntu

      16:13
    • 9. Setup Windows Sub System for Linux

      12:21
    • 10. Introduction to Java Programming

      1:37
    • 11. Anatomy of a Java Program

      4:34
    • 12. Your First Java Program

      22:35
    • 13. Java Key Word Identifiers

      4:37
    • 14. Introduction to Java Variables

      10:35
    • 15. Learn About Java Primitives

      5:47
    • 16. Char And Boolean

      16:14
    • 17. Arithmetic Operators

      9:39
    • 18. Java Unary Operators

      16:38
    • 19. Introduction to Debugging

      13:07
    • 20. Java Assignment Operators

      7:10
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

341

Students

--

Projects

About This Class

High paying Java programming jobs are going unfilled because companies cannot find Java programmers.

Do you want to start a career as a Java Programmer?

Start Here!

The Java Programming is the number one programming language in the world. Companies big and small rely upon Java for their software needs.

Even though Java first came out in 1995, the language has continued to evolve with every release. Each release adds modern features to the Java language, which maintains its popularity.

In this course, you will learn more about the Java programming language, how to setup your computer for Java programming, and write your first Java program!

Meet Your Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Java Programming Course Introduction: all right. I'd like to welcome you to Java program of Beginning of the Guru. Now, inside this course, I decided, take a spin on it. A lot of existing courses. Other. I wanted to create a very pragmatic course. Something's focused on how Java is used in the real world. I personally have been a Java developer for a very long time. I worked with some top clients. I work with a very talented group of Java developers. Right now, we've got a lot of deep experience, a lot of experience specifically with the Java programming language. We know the ecosystem. We know how companies air using it. We know the world class companies that how job is being developed there And that's when I wanted to bring into this course, is to show you not only the mechanics of being a Java developer, but how Java is actually being used pragmatically in companies every day because I want to get you a job as a job a developer, that is. My goal in this course is to get you hired as a job developer. Now, I structure this course strictly for beginners, so you don't need any programming knowledge. Adul, if you've done programming with a different language, great, you'll have, Ah, a little bit of an advantage over others. But inside this course, I'm assuming that you have zero job, our programming experience at all. So that's kind of the foundation of this course. And I want to take you step by step, not only learning the features and mechanics of the job of programming language, but how to be effective, how to be productive using the Java programming language. So that is my goal in the course. And I hope you enjoy taking this course. There's gonna be a lot of content in this course, a long road ahead of you. But if you apply yourself on the other side once you get through all the content and discourse, I think you're gonna be ready to ace that Java programming interview. 2. Meet Your Instructor: So I thought I'd take a moment to introduce myself because you're probably wondering, who is this guy John Thompson, and why would I want to learn how to program General Java from, uh, I've been in the industry for quite some time, actually entered into I t back in the nineties. So Bent, been around, definitely been around the block. Now I started off my career in the information technology, I guess, is official term. Back in the mid nineties, coming out of college, I did a dual master's program, won the Masters was in technical communication. The other was more around adult education, and through this I became a trainer. I entered the training program for a company that wrote custom software so as developing custom training programs for these major corporate clients, where we wrote custom applications for them and I was writing the training materials for that. My career took me into not knowing writing that, but I evolved into actually running projects, so it became a project manager. I had the joys of running project schedules and not only hiring people to help out with the projects, but coordinating with the client timelines budgets. It was a lot of fun, but through that I got to see programmers, these programmers for making just as much as me, if not more on. They didn't have all the headaches of being responsible for budgets and timelines and hiring and buying stuff and trying to do all the stuff you need to do bring together project. They were able to just go and do their magic right there. Code have working code because it was an I T project. We were delivering software that was the name of the game at the end of the day and they were well paid. They had great schedules, great lifestyles and at some point it clicked in my head, said There's a problem here and I decided to change my career path and start focusing on my technical skills and eventually became a Java developer because I was already in I t. In the field working with some really brilliant people. I had some great mentors along the way, so I was very fortunate to have some very smart people take me under their wing and show me some of the ropes. Since then, my career has been ah lot of fun. I've worked with some absolutely brilliant people along the way, and I kind of went into a consulting role I actually worked for. Pivotal. The company behind Spring Framework Spring is a popular framework. It's a Java based framework for creating these large scale and a price class applications or gets the buzzword. Now today is a cloud native, so these large enterprise class and applications So that's what spring is. And I actually worked as a pivotal consultant for some time, helping companies implement these features using the spring framework. So that became an expert, which spring actually spoke to spring one. Some conferences along the way, talking about different things within the spring context. Now job, of course, is all the underlying foundation of the and through my experience, I've seen and worked with a lot of different shops, a lot of different people, a lot of very smart people, some not so smart. But I've seen what works, what doesn't. And inside this course I wanted to create a job, a programming course, to take you from a beginner to master the language. I remember where I struggled at the things that I struggled out with language, and I also look at other things as faras how things have presented. There's some things that just simply aren't used that much in the language. So I am focusing on, uh, things inside the scores from my background in my experience, how job is used in enterprise to help you become a more effective, pragmatic and productive developer with the Java programming language. So I think my background using the Java programming language, having so much experience in the industry and also making that transition from a project manager to add Volver and my educational background not only being technic communication but also having a master's in education. I think all that comes together and I hope the content ahead you are really gonna enjoy. And I love to see you find success in your future being a job, a developer 3. Why Learn Java: Quite often I get asked the question, Why should I learn Java? Why do I want invest that time in learning how to program? Job, not a job itself is the number one programming language in the world. It has been in that number one position for some time. It was released in 1995. Initially, there is a little bit of interest in it. But the interesting job rapidly group because of its capability to write once and run anywhere. No. Since it was released, there's been a lot of major releases. The language has continued to evolve, with more and more modern features being added to it. Another key point about Java is that it's got a thriving open source community. A lot of these products are commercial, great products, and they're widely used in company. So these companies leverage he's open source projects to get a lot of value. And because of that, companies are looking for Java developers. Right now on indeed dot com, 58,000 jobs are available for Java developers. This is everything from entry level to senior level people, mobile people, so a lot of different things that are available for job. Another reason why chop it so popular? It's have been around for a long time, so there's a large community of knowledge not only blawg post and documentation that you can get all of mentors. And if you think about companies, they have a large investment. So if they've been a job a shop for a long time, they have an existing code base. They have existing employees, so they have that critical mass bill. And employers know that if they need Java developers, they can go out to the job place and find people that Java skills. Another key point is Oracle continues to improve the language of modern features. We just had a job. 11 come out. Ah, lot of stuff was added to it. Job 12 is coming out. New features are being added to the language all the time. So for Java developers, I don't see any change in demand for job opportunities out there because you have this critical mass that has been built not only with employers having a huge investment in Java , you have a company like Oracle behind job, continue to evolve the language, Then you have the open source communities out there Some thriving open source projects. Obviously, I'm a little biased toward Spring framework. Spring has been doing phenomenal that they've just grown and grown eso you're seeing more and more companies adopt languages like our frameworks like spring because of the thriving ecosystem behind Java. So I don't see the man for job developers changing in the foreseeable future. So if you are looking at learning a programming language, Java is a terrific language. I'm not discounting other languages out there, but of the language is the major languages out there right now. None of them have the critical mass of employers. None of them have the open source community. And generally none of them have ah company like or will be hanging. At least not all three of these pillars out there so thes don't work in conjunction with each other. So it is going to continue to keep the demand for Java. Developers are very, very strong. 27 50 I never carry while I'm working, ruins the lines of my suit. But how about Chris by five? Okay. Merry Christmas. 4. Introduction To Java Programming: So what is Java? We hear the Java programming language quite frequently, but a lot of people don't understand exactly what Java is. Java is actually an object oriented, general purpose programming language. It actually has no relationship whatsoever to JavaScript. That's a very common misconception that job in Java script or similar languages, they're fundamentally different. They do share the name Java, and they do share some Syntex elements with knowing JavaScript See C plus. Plus, They all have similar syntax, which helps developers move from one language to another. Now Java itself was founded by James, grossing in 1995. Hey was working at Sun Microsystems at the time and job. It became wildly popular, however. Back in 2010 Oracle acquired Sun Microsystems. So now Oracle is the owner of the Java programming languages Now. Initially, early versions of Java were actually quite slow, But the performance of Java as a programming language has caught up to really comes pretty close to native language is now, so Java is very performance now. Some of these early performance problems with Java were related to the fact that Java is a platform independent language, meaning that once we compiled Java. We can take it to any platform and run it. So if I compiled Java on Windows, of course it's gonna run on Windows. But I can take that compiled code and move it on over to of Mac OS system. Run it there or it could move it over. Tell Lennox run it there. So Java has support for most major operating systems out there. And once it is compiled down to what is called byte code, we can take that bike coat and run it on any of the supported platforms. So this is kind of a first for, ah programming language to have such wide support across so many platforms. And this, really it does help with the popularity of the Java programming language because it can run under Windows, it can run under Android. Obviously, that is the language of Android runner Lennix, which Android actually uses a flavor of Lennox Mac os as well can sport Java, IBM mainframes that they support Java so it can be supported in all these different environments. And in this environment, what's happening underneath the covers there is that by code is being interpreted by what is called a jbm jbm is called a Java virtual machine. Now this virtual machine takes that by coat and basically think it is like an adapter. So it's gonna take that by code and provide an adapter for that specific operating system so the bike code remains the same, but that adaptor changes for each operating system out there. So it gives us a lot of flexibility as Java developers because we can write that code once and deployed to any supported operating system through that jbm no, you've probably heard of the term Jae Beom. There's also a term J R E and then also JD Cave. So these are three very distinct terms. JV M is gonna be the job of Virtual Machine Jr E is going to be the Java runtime environment, and then J. D. K is Java development kit. These are all different things, so the jbm it's actually included in the j. R. E. The J. R E does not include any tools to compile job to buy coat. That is what the J T. K is. Force A. The job of development kit allows you to compile job on the bike code that J. R. E is the runtime environment. That is what provides the JV M and for the specific operating system. So when we we are deploying Java code, we need tohave a J r E installed on the target operating system where the job is gonna be running. When we are writing Java code, we need to have the J. D. K installed so we can not only run job by good, but we can also compiled down to Java by code. Now, as we start developing with Java, we need to start paying attention to the specific route release of Java. Right now, Java 11 is what is called a LTs release and long term support release. What Oracle is done and overseeing the release process of Java is companies like to have a very stable release process. So they are going to be working with Java 11 for some time. And this is a long term support, their oracle, saying, We're going to have this release of Java out there, and we're going to support it for a very long time. I think it's six years, six or eight years if I remember correctly. So there's Nissa is providing company support for the job of environment, and this includes things like bug past patches and technical support from Oracle needed for that version of Java. Now Oracle's also changed the release cadence. Every six months they are going to created release of Java, said Job. 11 is the LTs release Right now Java 12 has come out and recently Java 13 came out and these incremental releases are replacements. So if you are on Java 12 you are expected to update the job of 13. And where there are non breaking changes, those features are brought back into job 11 a smudge as possible. So these air all things for long term support. But for the people running Java 11 they do have uninterrupted support. Your doing these incremental releases, you are expected upgrade to the next ones. For the purposes of learning job, I would stay on an LTs release and this is what companies are gonna be utilizing. And the every six months the cadence releases these air for new features. You might want kick the tires on them and check them out. But for anything that you were going to be coding for production definitely go with the LTs release because that is that the way that you want to be going now. Java itself does have a number of different vendors, so the Java A P I is open source. Anybody can develop against it. There is a formal process for you to develop your own J R E to run on a platform. Oracle does certify these companies. There is a certification process. There's a whole testing process is fairly complicated. But with that said, Oracle does provide Java. Then there's a open J. D. K, which Oracle heavily contributes to. But then other vendors like Amazon Red Hat, IBM, they do have their own implementations of job. Google for Android has their own implementation of Java, so these air different alternative Jet Java applications. For the purposes of this course, I would say Go ahead and use the Oracle or open J. D. K flavors of Java just to be for consistency. There is no cost fit. There's people are getting concerned that the Oracle version of Java now requires Oracle. Supports of the Oracle version of Java does require support for production environments of Oracle clients. So the caveat is for you. As a developer, you do not need to pay for Oracle and the other alternatives, such as open J D K. That is an alternative open source, no cost, no frills type of job that you can utilize that. People got really concerned, saying Oracle's charging for job work was actually charging support for Java and requiring people to that have Oracle products that are using the Oracle job in their production environments. Oracle wants to be charging them support, which is gonna give companies like think that you're like a large bank or something. You want to have that technical support. So if something does go wrong, if there is a bad bug that has found a security flaw that is found, you wanna have that support so that you are protected and you can get here. Issues rectified quickly That that is why Oracle is charging support for production environments. But for open source developers, developers in general, developing on their own laptops, you do not need to pay support for Oracle for Java and you do have the alternative to use any of the other vendors available for Oracle. For Java, you can open JK It's a great great option t utilize over Oracle. So you do have these alternatives and if you are running like a start up, you can use open JK for your production environments rather than paying Oracle for support for Java. So there are number options still very robust and driving open source community around Java . 5. What Is Needed To Program Java?: setting up your system. Do Java developments actually fairly simple and pretty straightforward. The first thing you're gonna need is a J. D. K. Installed in the J. D. K. The Java Development Kit. This gives you all the tools to develop and compile to Java by coat Mrs Different than the J R E, which does not include a compiler. So the J R E the job of run time environment is just for running job applications. You see this installed on a lot of computers out there. The J. D. K is larger and has all the development tools for you to develop job applications, including that Java compiler. Now there are several different flavors of job on the JK. Available the primary one in 2000 December 2018 Oracle magazine, Oracle's Java magazine, ran what they call the largest survey of ever, and it was over 10,000. Developers responded to the survey and talked about which J. D. K they were using. The largest one was from Oracle Corporation official Oracle Publish Mint. The second largest was open J T. K, and I think either one of those is perfectly fine toe move forward with. You just need to select the J. D. K for your operating system and install that so you can get started developing Java applications. Now, once you have the J. D. K installed on your system developing job, it becomes a very simple process. You can write Java code just using a simple text editor. So if around Windows, no pad will work perfectly fine. Sublime is a very popular text editor, so all you really need is some type of Texas better. Some people, even non linear systems usvi I of them to edit Java files because ultimately, the Java source code file is just a text file. But it's just a plain text file with the extension dot java so that this is all all it is. So you just need a simple text editor to go in and edit a file and create a text file using the jobless in text. And then the Java compiler could take that file pilot down to job a white coat. No, While you can actually develop Java code with just a tech center, it has rarely done that way. What you want to be doing is using a I D E. Mrs Integrated Development Environment. Think Oven ideas Caligari a word processor for but for programming. So it's a very elaborate program that helps you developed so the I D has a lot of features in it, and it is specifically a software tool for your dust up that helps you edit and produce working program code. Now there's a number of different options available for ideas out there. Eclipse used to be the most popular one because it is an open source project have been well established. Actually, IBM established Eclipse that used to be a paid product than they open source. The the clips i D. And it's been very, very popular. However, the last few years. Jetbrains is a company that produces ideas. They have a product called Intel. Ajay and Intelligent has been taking over the market share. So basically, you see you see eclipse up here and now. Over the last few years, Intelligent has been rising in popularity as faras the number of people utilizing intelligent. Now there's also net beans is out there. That's also very popular. Oracle has J developer, which just doesn't seem to get much traction in the market place in the industry. What I see the most is people working for companies. They are typically using jetbrains that seems to be the most popular one. There are edge cases where there are companies still using it clips. But like I said, over the last few years, that has been changing quickly. Intelligent has become the most popular I d to be used with Java development. Intelligent does come out in two additions. One is the community addition. This is open source and completely free to use. The second is the ultimate edition. Now the ultimate edition is a paid product. You do have to buy a subscription to it from jetbrains, and it does come with support, so they may have a really great support system. Now the primary differences between the two the community edition is perfectly fine. As a Java i e. The ultimate edition includes a lot of tools that enterprise developers are going to need, such as tooling around the spring framework, which obviously I'm a big fan off. If your are a beginning Java developer, I would say Just stick with the community edition because the ultimate edition is gonna have a lot of bells and whistles that you simply are not gonna be able to utilize. Yet once you do start beginning getting into a career where you are moving up in our price , definitely consider the ultimate edition because it does have a lot of tooling that is gonna make your life easier again If you're just starting out with Java development. Community Edition is perfectly fine to use. 6. Install Java 11 Windows 10: No. One of the first things that we need to do to install Java on Windows 10 is toe head over toe oracle and download the J. D. K. So we need to go to the Oracle website, select the J. D. K. For our system and then downloaded to our computer. I'm going to jump over to Chrome now and show you exactly how to do this. Okay, To install the java J D. K for Windows. I just want come over to a browser I am going to use Ah, Google Chrome and open that up. You can really use any browser you'd like and I'm going to say Windows 10 J D. K like so just search on that. And now you can see that the 1st 1 is the installation that is directions on how to install . We actually want to go to the Java SC. That's Java standard edition downloads. I'm gonna click on that, and now we can see that it's coming up with several additions for us. The job of 13 that is the most recent release. But this is not an LTs release. We want to be working with the LTs really someone scroll up a little bit and can see here in their job. 11 05 That is the current LTs release that we want to use. So I'm gonna grab that right now. I'm just gonna click on download and maybe scroll up a little bit here and we can see this is the Java sea development. Get exactly what we want. We have to click here to accept the license agreement. And now we need to come down to the windows and I am going to take the execute herbal. So this is Ah, binary execute Herbal that that will run the installer. Somebody click on that. Now, Oracle does require you to create an account. I do have a very old one that I'm going to go ahead and utilize here when we click on Sign in. And if you don't already have an Oracle account, you can click on, create account and set up an account and you can see here the download has started is gonna take a few seconds for that to download from the Oracle site. Once we have the job installer downloaded to our system, we need to run it and have it. Install the Java J D. K. On our system. Now, once that download completes, we can just come over here. Since we downloaded the execute Herbal, we're just gonna go ahead and click on that. You can see that Windows is asking me if I want to go ahead and start. I'm going to say yes and I don't need chrome open a more so I'm gonna go and close that. And now we can see that we have the installer up on the screen and I am just gonna step through this saying next and we definitely want the development tools and source code. So let's go ahead and continue with that. And also note that it's going to be installing to see Dr Program files Java J d k 11.0 dot five. So that that's important to remember the path to where your java is installed. See that the Java process goes by pretty quick, and at this point, the job installer is done and I can click on close here. Can this point The installer did install Java on terror system, but it's not fully configured for Are you? So we want to set up so that we can execute Java from the command line and also programs confined Java. So what I want to do is come in here and I'm gonna click into the file Explorer and let's go to this PC, and I'm gonna double click on that and job is gonna be installed under program files. Remember, we saw that in the installer, and here we can see this is where the Java J T. K. Has been installed. So what I want to do is come up here and we'll click on this and right click and say Copy. So I'm gonna copy that path to the clipboard because I want to set that up is an environment variable. So I'm done with this. I'm gonna close this window now come down here to the window on the lower left to right, click and say system, I'm just going to envy. And I want to edit the system environment variables. Now you can do it. If you're the only user on the system. I prefer to do the system environment variable. So I'm gonna come up here and click on that and now I want to say come down here to this lore, but that says environment variables click on that. And now this window comes up and I have user variables for my user account or down here. I have system variable. So I want to come down to the system variables and on the path I want to come up here, click on that. And now I'm gonna add in a new path, and I'm gonna pace that in and what's very important for it? To find the executed ALS, you have to do slash Ben. So this is a very, very easy up to forget. So you want to go in there and make sure that not only you're saying the Java home, but also the slash bend to the path. So this is what Windows is gonna be using toe look for execute herbal file. So we'll go ahead and set that and I'm going to say click on. OK, here. Now, while we are here, some Java programs are gonna be looking for ah variable called java home. So here what I can do is I can click on new for a new system variable and I want to java underscore home. This is fairly standard for Java programs to look for an environment variable called Java home. And I'm gonna go ahead and pace that value and and in this case, we do not do the slash been. We're gonna do Java home and miss type that their lips java home. Not Heym. Sorry about that. So here we do not put the BIN folder. We want the directory for the J. D. K. Itself so that there's additional sub folders under there that some programs need to reference. And any program that's looking for Java home is going to know that for the executed balls, it has to look in the bin folder. So now I'm just kind of say okay here and okay there, Click that and close that out. Now, once job is installed on our system, it should be available for our use. I'm gonna show you from the command line how we can verify that we do have the J. D. K. Installed properly and it's working. There are two Java commands that we can use from the command light. One is Java, just simple java, and we're going to U minus V to get the version of it and that will tell us that the job of executing ble is available on our command line on our past. So it tells us that job is installed. The other command is Java Sea. So a java with the CNN, This is the Java compiler and do a Java C minus v for the version of it that will tell us that the Java compiler is installed. It's, Ah, pretty easy mistake to make to install just the Java runtime that J. R. E and not the J. D. K. And if you have installed just the J. R E. If you do Java Sea, you will get an error saying that Java C has not found. But if you've probably installed the Java J D K Java Sea will exist and you'll get output from that. So by using Jeff Java C minus V that tells us the version of Java compiler installed on the system. I want to verify that Java is installed and working properly on the system. So what I can do is come down here to the search bar and just click there and say CMD and that is for the command prompt. So I want to get to the command line here. I'm gonna just hit that and hit Enter. And now you can see them at the command. Prompt. And all I want to do here is do Java minus fee for version and actually version. Sorry about that. Yet Spell up version for that. So now you can see that I'm finding java. It is 11.0 dot 5 to 1 that I did install. And this is effectually the JV M. So this is what actually runs Java code now to compiled Java code. I want to check Java Sea. You know what also do version like so and now you can see them am getting a response back from the Java Sea. So this tells me that on this system I do have the J. D. K. Installed Java is the runtime. Java Sea is the Java compiler and the Java compiler is not included with the the job of Runtime. So he installed to J r E Java Sea will not work but here by having java sea version and getting a response back. We know that this is now valid so I could do something like job. Ah, this version. And here. If you had not stalled the J. D. K. You would see this, but it would be for Java. Sea is not a recognized and term plan. However, I do have Java sea installed and we are getting a response back from that Execute herbal. Now that we have Java installed in and verify that it's insult properly, we won't go out and get the intelligent i. D. This is freely available from jetbrains. So we have to go out to the JETBRAINS site and download it to our computer system here. And for the purposes of this, I am going to be using the intelligence community edition. So if you're beginning Java developer, the community edition is perfectly fine. And that's what we're going to go out and grab from the Jetbrains site and download to our computer. Now I want to go ahead and install Ontology. The first thing I need to do is go get the excusable. So I'm gonna come up here to Chrome. You can use whatever browser good like, and I am just gonna search on tell Ajay windows and here you can see that the first it is download Intel J Idea. So I'm gonna click on that link, and now you can see that I have ultimate and community. Now you can get a free trial for Ultimate. But if you're just a beginning Java developer, no reason for that. So I'm just gonna come up here and click on this and I'm gonna download the Execute herbal file, and this will bring down the installer to my my operating system. Now that the download is complete, we can run the installer, which is going to install intelligent A onto our computer system here so that we can start using it when the download complete. Since I grabbed the execute herbal, I could just come over here and double click on it, and this is gonna open it up and windows will ask me if I'd like to install it. It's gonna take a second for it to come up, and now you can see I am asked if I want to allow this app to make changes to my system, and I'm going to say yes because I want to install this and now we can see that I have the set up dialogue and I am gonna close chrome out from the background so we can see this a little bit easier. You could see that I have the intelligent idea community addition set up, so I'm just gonna click on next to continue and installing it in program files. Jetbrains perfectly fine. So I am gonna proceed with that recommended location, and here we can see that it is asking us for a couple things here. So I am going to go ahead and installed a 64 bit launcher. Ah, I'll add in open folder as project. And here this the dot java. So that is the Java extension for Java source files. And then also weaken Set up the alternative jbm languages for groovy and Katelyn. So I'll go ahead and take those as well. And I don't think I need to update the path variable. So I am going to go ahead and say, Next on this is going to give us a new start menu folder so I'll go ahead and take jetbrains for that. And this is going to go through the installation process right now it's copping over bunch files from thence dollar into and our windows operating system. So I'm gonna pause the video and come back to this when it completes the skin. Take a minute for all these files Toe get un compressed in and salt into the windows system . At this point, intelligent is completely finished. And what I can do is just say, finish here. I'm gonna click on finish. I'm not going to run it at the snap. I'm just going to click on finished exit the installer and we can see that the installer did create a shortcut on the desktop to access and tell A J. Now, the first time that you run intelligence is gonna come up and ask you some questions about how to set it up for your configuration. I'm gonna go through now and show you some commonly selected stuff, something you probably won't need. And we'll just goes a step through the menu of options and get intel Ajay, configured for your use now to start up until a J. I'm just gonna click on the icon here, double click on that to go ahead and start up. The community edition of intelligence is gonna take a second for it to initialize in here intelligence gonna ask to import settings. So this is brand new installed, so I don't have any settings to bring in, so I'm just going to say Okay there. If you were previously using it, you would have the option to bring over your current setting. So I'm not gonna important any settings here, and we'll click through and say that I agree with this and I'm gonna go ahead and send uses statistics to jetbrains. This does not include personal data. So I think it helps them improve the product because they see how the product is being used in what features air being used. They can focus on those better. So I'm gonna go ahead and send those. And here you get to the dislike, the theme I've been using the ah Dark ULA theme lately. So I'm gonna go ahead and click on that and here the next is going to default plug and so intelligent does have a number of plug ins. You can go ahead and configure those and let's customized build tools. I never use Aunt, but I do use maven and grade also, let's go ahead and save those version control rarely used uh, marcato, get up. Get ah version. I almost never see that Aimar song a un select that. So by disabling these plug ins, you're gonna make intelligent use a little bit less memory and be a little bit more efficient. So I'm going to save these changes and go back test tools. I don't personally use tests, Angie. Ah, lot of people love it. I've been using Gene unit five lately, so we'll go ahead and go with that. Ah, swing. I'm just gonna disable swing because I don't use that android. If you need an trade development, go ahead. Enable it. I am going to disable that in here. I'm going to come up here on other bill tools. I'm going to say customize that I want my code. I don't need task management. XLT is nice. View an eclipse user. You can enable this. I am not going to enable that and um Oh, Java stream Do bugger. These are all good things to have gonna save changes and then finally pluck in development . If you're going to be developing a plug in for intelligent, you want to enable this, But I am going to go ahead and disable that because we really don't need that. And then next to featured plug ins. So I don't need Skela at this point in time. Ah, of them miniter. I don't need that. And then, ah idea features trainer. If you are new, you might want install this because there are a number of short cuts and stuff that could be utilized. I am not going to install that with this installation. So I'm just gonna go in here and click and start using intel, Ajay, and you can see that it does take, ah, few seconds for intelligent to initialize. And you can see now that I'm up on the screen here, I can say create new project. And this is gonna create a brand new Java project. And I can just say next I'm not gonna bring in groovy ocotlan just great. Next. And I'm gonna just say I'm just gonna say, test project there and you can see here it is going to fall to my user home and then idea projects and I'm calling this test project. So I'm just gonna finish that, and I'm gonna close out the tips of the day. You can see down in the bomb there is waiting for a second. Intelligent is going through doing indexing. So I'm gonna pause the video until that indexing is complete, what it's doing, it's going out and building an index of things that knows about your system. So this can take a moment to run. So I'm gonna pause this video until that is complete. And so indexing is complete and intelligent is now at the initial project view screen. And the one thing I want to check on here is I'm gonna come upto this project structure here. Click on that and we see that job. It was found. So it's got the Java 11 the 11 about five. So that's one part that I want to make sure, And here you can also say, set the language level that's also set to job 11 which is perfectly fine. I'm gonna click on OK, I just wanted verify that was installed Sometimes that I d might not find the Java installation. You'll have toe actually point it to it and tell it where is that? But here we did find java. Okay, so now intelligence is now ready to go and start developing job 7. Install Java 11 on MacOs: in this video tutorial, I'm going to show you how to set up your Mac OS system for Java development. Now, one of the very first things that we need to do is install a J. T. K. I'm gonna show you how to find the J. D. K on the Oracle website and download it and then we'll proceed with the installation steps . So I'm gonna jump over to the night computer now and show you exactly how to install the J T. K on macro us. Now the first thing we want to do is open up a browser as far is perfectly fine if you prefer to use chrome or firefights going, do that also. And I'm just going to search Google for Oracle J. D. K 11 and you can see here and got the job SC development kit. That's exactly what we want. Somebody click on that link and here can see this is the downloads for it. And we want to grab this Mac OS. I like the DMG version that makes things a little easier. Something coming that and of course, you need to accept the license agreement and here you're were required to log into Oracle. So if you don't have an account, you need to create one here. I do have an account, So I'm gonna go through that process and here so far is asking me to allow the download. I'm going to say allow it and I can see in the bottom screen this file is now downloading from from the Oracle site. When that is complete, we'll build to go in and start the install process. Once we have the job installer downloaded to our system, we need to run it and have it install the Java J D. K on our system. Okay, Can see the disk image downloaded here. I'm just going to click on downloads and click on that to open it can see that Mac OS is going head and opening up that disk image. And I just need to double click on the installer package and you could see here's pretty standard Mac OS installer. So I'm just gonna say, continue here and really no options there. Just go through and say, install. You are gonna have to give it your password. This is gonna make system level changes, and it takes just a moment or two to go out and install all the files It says Install succeeded. I am going to close that and I'm gonna go ahead and move that installer to the trash because we just don't need it anymore. Now there's one additional thing that we need to configure, and that is to set up the Java home. Some Java applications look for an environment variable called Java home. And what we need to do is add this to your profile from the command line. And if you come appear toe about this, Mac, if you are running Mac OS Catalina or higher, they switched over to Z Shell from Bash and Catalina so that there's two different ways that we need to account for here. So I'm gonna open up the terminal. And if you do echo Michael Dollar Sign Shell, you can see here that I have ze S h. And that means that I need to, uh, handle instructions for a CSH. If you are still on the basho, what you wanna do is a V I from your home directory bash underscore profile. So this is only if you get bash back from that not CSH so that Z show here. What we want to do is V I file name is Ze s h r c. So I'm going to use the V I editor for this. If you have a different text editor that you're comfortable with, go ahead and use that. I prefer V i personally. So this is new file. You might have a profile there already and again. If you are using the bash show, you won't be editing dot Bash underscore profile here. So I'm gonna hit I for insert. You know, we want to export job, underscore home equals. And here we're gonna do a dollar sign open Perrin, and we're gonna run a command for it. U S R no, I b e x you see living and we're gonna say Java underscore home. Then we need to do a close Peron and that that sets up that environment terrible. And just recently, under job 11 that they did add in this exact which gives us the path to the Java home and previous versions. Java did not have this. So now to save this, I'm gonna hit escape colon w Q And now does Thievy I commanded right and quit. And now I'm gonna exit this close this and but asking for a new job, a show. And here I can say that. Go the undersigned java gonna scar home and that that is the path to the Java home. So we need to get that environment barrel set up. And now, at this point time Java is completely installed under Mac OS. No. Once job is installed on our system, it should be available for our use. I'm gonna show you from the command line how we can verify that we do have the J. D. K. Installed properly and it's working. There are two Java commands that we can use from the command light. One is Java, just simple Java, and we're going to U minus V to get the version of it. And that will tell us that the job of executing ble is available on our command line on our past. So it tells us that Java's installed the other command is Java sea. So a java with the cfd and this is the Java compiler and do a job a C minus v for the version of it that will tell us that the Java compiler is installed. It's, Ah, pretty easy mistake to make to install just the Java runtime that J. R. E and not the J. D. K. And if you have installed just the J. R E. If you do Java Sea, you will get an error saying that Java Sea is not found. But if you've probably installed the Java J D K Java Sea will exist, and you'll get output from that. So by using job Java C minus V that tells us the version of Java compiler installed on the system. Now to verify that Java is properly installed. Open up the command line in the terminal application and what you want to do is job. Ah, minus version, I think in the intro video, I said fee, but it's actually version. So now I run that and this is actually calling the Java run time, and we can see that this is the Joe installed. So I have 11 not 05 installed. So now I know that the Java runtime is installed properly and to verify that the compilers installed in the Java Sea Maya's version. So that tells me that the Java compilers also installed, which tells me that the J T. K. Has been properly installed. So very easy mistake to make toe install runtime and not the J t. K s going to get that job a c coming back. You know that that is installed. If you were to do food version and this is something that's not installed, you can see that the command is not found. So if Java Sea was not installed, would give the command not found like I just did there for food. Now that we have Java installed and it verified that it's insult properly, we won't go out and get the intelligent i. D. This is freely available from jetbrains. So we have to go out to the jet, bring site and download it to our computer system here. And for the purposes of this, I am going be using the intelligent community edition. So if you're beginning Java developer, the community edition is perfectly fine. And that's what we're going to go out and grab from the Jetbrains site and download to our computer now to download intelligent we won't go back to safari, and I am gonna do tell a J. Mac OS and we can see here the top result is going to download Ontology. So I'm gonna click on that link. And here we have two options. Close the cookies When does not really need it. We have the ultimate edition in the community edition again for beginning job developers. The community addition is perfectly fine. So I'm just going to click on download and we can see here that safaris asked me to allow downloads. I'm going to say allow, and that's gonna take a few moments to download from jetbrains website. Now that the download is complete, we can run the installer, which is going to install intelligent A onto our computer system here so that we can start using it. Okay, after you that he download complete, you'll find it down here under downloads, and we just want to click on the disk image. There, you see, it takes a second toe open this up and installation of intelligent is very simple. We just grab this icon, drag and drop it over toe applications, and after a moment until Jay will copy it's contents over. And when that is complete, one thing I like to do is come up here to applications. Double click on that and we'll find it in here. See, there's intelligent I D. C e for community addition, and I like to come in here and drag it down to the dock. You put that next to safari, and that will make it a easily accessible so I can close that bulls. And one thing we want to do is come up to find her and we can amount that disk image. Just click on that and then close finder. Now, the first time that you run intelligence is gonna come up and ask you some questions about how to set it up for your configuration. I'm gonna go through now and show you some commonly selected stuff, something you probably won't need. And we'll just goes to step through the menu of options and get intel Ajay configured for your use. So to launch Intelligent from the launch bar just double click and will take moment for its start up. I could see the icon is bouncing. It goes through a verification from the first time you won't see this after you run it more than once, so it goes through and verifies it. And now it's saying, Hey, I downloaded this again. This is only gonna be for the first time, so I'll go ahead and say open that is assigned artifact and knowing that it is from intelligent, you can see that it's asking me for notifications. I'm gonna allow that. And here, if you've been using intelligent, you could bring over settings. In this case, it's a brand new install. So I'm not gonna bring over any settings and say OK, and we get to agree to the privacy policy to keep the lawyers happy. And I normally do send usage statistics. I hope so. Japanese developed a product by blowing people what they're actually using. I prefer the dark yellow theme. If you prefer the light thing, you can do that. And of course, you can change these later, too. So now it's asking if you want create a launcher script and say yes now we have some default plug ins, and I like to go through these and just enable what I'm gonna be using. And by doing this, it helps the memory footprint on intelligence. So you're not gonna be using things best to leave them disabled. It makes the application of low but more efficient. So I'm gonna come through here and show you some of my typical selection. So I'm gonna come under Bill tools I haven't used and forever. But I do switch back and forth between maven and grade all quite often. Version control. Get get hub. Never use that guy. And I am used the version for a very long time. If you are using subversion, leave these clicked test tools. Ah, a lot of people still like test N G. I just have not been using it much lately. I prefer Jay in it myself. We're gonna save these. We don't need the swing designer. I'm not going to be doing android development. Let's see here. I'm going to leave all these these air, all nice tools. So by code, Tess management, that's nice little thing you can leave to do so in your code code and whatnot. Eclipse. I do not need Eclipse Interoperability Song. I save those changes and then the plug in development kit. This is gonna be if you're gonna be developing plug ins for intelligent, and I am not going to be doing that. So disabled that featured plug ins here. If you are doing Scala. Ah, idea of them. Vim editor and features trainer. I don't need any of those. So I am just gonna say, start using intelligence. Click this button at the bottom Here. This is for the installation of that script. And now intelligent is starting out for the first time. And what we can do is create a new project. And now it's gonna go through the project window. If you were to have the intelligent ultimate edition, he had have more options here. Well, you do not. So I am just going to go through and create a very first job, a project I'm to see click next here next and is a test project. And you can see here it comes up to your user home idea projects. I usually like to just start a simple folder cold source SRC and store everything in there . You probably have your own workflow about where you'd like to store things, but ah, good idea to do off your home directory. And that's what that little squiggly line the tilde means for the home. So I'm just gonna click finish here. I'll take intelligent moment to initialize the project, but at this point, until a J is now ready to go for Java development. 8. Install Java 11 Ubuntu: in this video tutorial, we're gonna go through and start setting up clinics a boon to for Java development. No, when the first things that we need to do is install the J T. K and the first step. But that is going to be downloading that from Oracle. So we need to goto Oracle's website sign into their site. So if you don't have a local count, you'll need to create one through this process. But I won't go through step by stuff and show you my account how we signed find, find it on the Internet. Which version to take, and we'll go through and download the Oracle Java development kit. Get that downloading now. No, in a boon to, And I just want to come over here to Firefox and you can use whatever browser you'd like toe to use. I'm just gonna use Firefox since it's already installed. Open this up and I'm going to search for Oracle J D. K 11 and here I want to go to the Java s seat development kit downloads. Click on that and come up here and I want to say accept the license agreement and then come here and I want this tar gz addition. So I'm gonna click on that Norgle is gonna take me over here to sign on screen. Yeah, and her in my oracle count. And if you don't have Oracle account already, you'll need to create one and go through that process. I've had a his oracle count for some time, and I'm just gonna click Sign on. Don't say that and hear what you want to do is save the file. So I'm actually gonna say do that automatically. Don't open it up with archive manager That can cautious medics. We actually want to be working with this archive. So I just say, save the file. Gonna click, OK, and that's gonna take a few moments to download in the background. Once we have the job, Vince Dollar downloaded to our system. We need to run it and have it install the Java J. D. K on our system. So to complete the job installation, what we want to do is come over to the terminal, click on show applications and take the terminal. And the first thing that we need to do is create a directory. So we've downloaded the J t k But we want to use the app installer to actually do the insulation. So we need to do pseudo we're gonna copied over to cash to my p Far cash J D k 11 Staller local No, miss the maker. So pseudo is gonna run it as root we are making directory minus p tells it to create anything that's missing along the way. So we want fire Cash Oracle J D. K 11 installer local And then we want to pseudo CP and we want to copy that into that. So I'm going from the download's director so it's gonna be downloaded to the dominance directory. There's J T. K. And now I want to say the slash fire last cash Oracle installer local. And if you're nude Olympics to get everything to complete, I'm just hitting the tab key. The tab key is gonna dio on auto complete so that copies it over. No, undue Sudo and cap, we'll add in this repository is going tpp a colon clinics, uprising slash java get a little bit of warning here, and I'm gonna hit enter toe except lit, and it's gonna go through and do the installation of this tool to help us install Need Java application. Now we want to an update. Good update. Next. We want to do sudo at stall Merkel job 11 Stoller local. Get a warning about the dough space I'm going to say yes. Continue. Now this is gonna go take from that archive file and it's gonna be installing the Java files and we must agree to a license near we need to hit Tab. Just highlight the okay. And we're going to say yes, keeping Oracle's lawyers happy with our agreeing to a license and going through the acceptance process. And that's gonna take another moment to complete the installation. Now, the last thing that we want to do is go ahead and make this Java installation. Are our default in the way we do that is gonna be pseudo Yeah, Good stall. Miracle Java. 11 said Steve Holt, local Like so. And at this point, Java is now installed. And the next thing that we need do what? Just one more thing. Some Java applications. They're gonna be looking for an environment variable called Java home. So we need to set that up and here I'm going to start up a second terminal and when I say which Java, we can see that I get this user, Ben Java. But that is actually an alias. So if I do ls s o r a s a user been Java. We can see that that is actually at link. So that beginning character on the line above my prompt. That means that that is a link and that is playing two, etc. Alternative job. So let's do the same thing on that. So I'm gonna look at Sea Alternatives job, and now we can see that is where the actual job insulation is. I'm gonna go back to the top window and hear what I want to do is just a CD. Make sure that I'm in my home directory and if I do no less mass on t r a a shows that hidden files, you can see that I do have ah, bash R c. So what I want to do is edit that file. So I'm gonna do a V. I and some people prefer to use the bash underscore profile. That's acceptable as well. So I'm gonna go ahead and edit my Bashar see and here, I'm gonna hit Oh, for insert a line Say export Java underscore home equals and I want to do the slash usr slash l I be lived JV job. Ah, dash 11 dash or coal. And here I don't want to the been Java putting in the actual home directory of the Java J D . K installation. So that's exactly what I want their the been folders all the execute a bles. So it we don't want to do that. We do want to study exactly the job a home So that does that. So hit escape and do a w Q for right. Quit exit that we'll exit this as well and I could bring that back in. But this is a little bit easier to make sure that Java home is persisting between sessions . So and we get a not a valid identify where oh, I see what I did. I have a dash there instead of ah equals. So just said it that again you hit X for delete I for insert equals on w Q. Over. He starts terminal. That's better. No air message on startup. No, if I do an echo are saying Java home, we can see that the Java home is now set. No. Once job is installed on our system, it should be available for our use. I'm gonna show you from the command line how we can verify that We do have the J. D. K. Installed properly and it's working. There are two Java commands that we can use from the command light. One is Java, just simple Java, and we're going to U minus V to get the version of it. And that will tell us that their job execute a ble is available on our command line on our paso tells us a job is installed. The other command is Java Sea. So a java with the CIA. Damn, this is the Java compiler and do a Java C minus v for the version of it that will tell us that the Java compiler is installed. It's, ah pretty easy mistake to make to install just the Java runtime that J R. E and not the J. D. K. And if you have installed just the J. R E. If you do Java sea, you will get an error. Saying that Java C has not found but if you've probably installed the Java J D K Java Sea will exist and you'll get output from that. So by using Jeff Java C minus V that tells us the version of Java compiler installed on the system. Now, to verify that job is properly installed, I'm gonna come to the command line terminal again. And here I want to make sure that job is installed. So I'm going to Java minus version. I believe I might have said minus V in the Inter video. But it's actually version. And now that we can see this is the job of run time environment. So this only tells me that the J. R. E has been installed on the system. Now I can do Java Sea minus version, and now I'm getting back the version of the Java compiler. So the existence of Jobs see on the system tells me that the J. T. K it's been properly installed. So it's very easy mistake to accidentally a solid Java runtime environment and not the Java compiler. And if I had not installed that, I'll just do food version of that did not exist. I would get something like this so I get told that Java Sea was not found. So in that case, you'd have to go back in there and saw the proper J T. K. But in this case, since Java sea is there, huh house to spell it right, So they're there. Now we we know that is there. Now that the download is complete, we can run the installer, which is going to install intelligent A onto our computer system here so we can start using it now, running into boon to what we do to install software. We just click on this boon to software that can come over here, click on this and search for intelligent. And here you can see we've got several different options and I want the idea community. So I'm gonna click on that and then just say, install and we could see that's asking me for my password. We'll go ahead and give my password authenticate, and now this is gonna install in the background, and this is gonna take a few minutes for it to go through the installation process and I'll come back and show you the sub. Now, the first time that you run intelligence is gonna come up and ask you some questions about how to set it up for your configuration. I'm gonna go through now and show you some commonly selected stuff, something you probably won't need. And we'll just goes a step through the menu of options and get intel Ajay configured for your use. Now, once the installation process completes, it will switch over to this launch. But I'm just gonna go ahead and click on launch to start up in Tell a J from the application installer. You see, it took a second for it, toe come up. And if you have a previous installation could bring over settings here, I don't have a so I'm just gonna click, OK? And we need to confirm jetbrains privacy policy to accept their terms and keep their lawyers happy. We'll click, continue there, and I normally go ahead and send usage of these air Anonymous statistics that help jetbrains improve their products. So let's go ahead and say, son, And while that's launching, I'm gonna go ahead and close this in the background. And here you have the right the my like the dark yellow theme. There's also a light theme and you can change this at any time. So I'm gonna just go ahead with good old Markkula. The plug ins. This is kind of important. If you have plug ins that are running, it takes up system resource is memory. And what not if you don't need him. And I say disable. I'm someone to go through and show you the ones that I normally utilize So we can come in here for build tools. I never use Aunt, but I do use Maven and Gretel quite frequently, so I'm just gonna disable aunt Version Control. I don't use thes two here, but I do use getting get up quite often. So enable those And then for the testing tools, I use J unit quite a bit. I used to use test and cheap, but I haven't used that for a long time, So I'm gonna disable that and then the coverage tools. Those are definitely nice to have installed. So save those swing. I'm not a sewing designer. Don't do android development either. Some disabled those. Now let's take a look at these miscellaneous tools. The bike code veer needs you want I never use the clip, so I'm gonna disable that. Terminals handy Java streamed. Buggering Gamel. Those are all good. Could have something. I go ahead and save those and go back now. Ah, plug in development. Plug involvement. This is for developing I d plug ins. I don't need that. So I'm just gonna go ahead and disable that. Next we can look at future plug ins. I'm not doing scholar development. Don't need this for emulator. And then the features trainer that's optional. If you are, go through that and take a look at that. You can. If you're new to intel, Ajay might not be a bad idea to try that. Now, I'm just gonna go ahead down here in the lower right and say, Start using intelligence. No, it intelligence, starting up for the first time. And here I can say a great new project. This is set up a new Java project had takes a second for it to initialize. And here you can see the different projects that we can create. If you are using the ultimate edition, you're gonna have additional options here. So I'm just going to say next year for ah, plain Old Java project and you can see here is putting it in my user home idea projects. If you have workspace director you like to use override it. Now, I'm just gonna call this test project like so. And I'm gonna click. Finish No. Until a J is gonna go out initialize that project. It does take it a second here and we see that the windows coming up and it is initializing a job, a project for the first time. And you do get tips of the day. I'm just gonna close that and you can see two processes air down here. It's actually indexing files right now, and that can take a second run. So that's perfectly normal for starting up intelligent the first time. It's got some housekeeping tests take care of. But at this point, we have job installed. We have intelligent installed and we are all ready to start developing Java applications 9. Setup Windows Sub System for Linux: in this video, I'm gonna show you how to set up the Linux subsystem for Windows. And this is ah, kind of an optional step in the videos of my courses. You will see me using the command line. Sometimes I typically I'm working from Mac OS or OS X, depending on your preference. And this is a bash shell so special. And this is the same under Max as it is under Linux. So Bash has been around for Young's, I think, since the seventies. Somebody can fact check me on that if you want. But Bash have been around for a very long time. I've been using best for since the early days my I t career, which was some time ago, and I'm gonna show you how to set this up within Windows. So the Windows guys have actually done some pretty interesting here. The Windows team, I should say it's not that I did some reading about how they did it. It's actually they're calling it a sub system. It is not in a virtual machine, is not in a container. Forget exactly how they termed it. But you are getting a in essence of a boon to or Lennox running within your system. And so the installation process for Java development is twofold. One we need to go in and set up the Lenox subsystem and get a version of Lennox. And so I'm gonna show you how use a boon to get that installed and running and how to get to the linens environment. There. You're actually running within its kind of a VM, but that is a separate system. And then there's a second step to go in and installed job. It might be a little confusing because you have job installed under windows. Jbm is set up there. But now you're gonna be in the sub system, so it might have windows here. Now you're in a subsystem that it's running Lennix. And with that that Lennox environment, we also need to give that limits environment access to the Java tool. So that is a separate installation stuff, and I'll show you how to do that. After we get the clinics in salt the clinic subsystem installed. I'll do that now this video to show you how to install the windows subsystem for Lennox. So we want to come down to the search bar and search for Power Shell. And here you can see the APP is up. You might have to click on the arrow to expand it out, and we want to run this as administrator, so that's important. You can't just run it normally need to run as administrator, and we will say yes. And now from the command line, what we want type is the command and does Windows optional feature minus on line. Maya's Future name. Micro saw Windows sub system Dash Lennox like so So it's gonna be enable Windows optional feature online her dash online dash feature name, Microsoft Windows Subsystem Lennox and that's gonna take a moment for it to download. So once it goes through the download process, you're gonna get this prompt that you need to restart the system and we just want to say yes, the default is yes and hit. Enter and I will come back once Windows has restarted. Now, once your system is restarted, everything is installed to enable that subsystem for Lennox. But we want to come in here and verify your build, so come back to system and we want to do the system information, app and you want to look at your build number. So I have 17 763 and you must be 16 215 or higher. So if you have a build number lower than 16 to 15 you're gonna need to update Windows to continue with the instructions in this tutorial. So the next thing you want do is open up the Microsoft store and just click on that and I'm gonna come up to search. I'm gonna search on a boon to and I'm gonna click on that for the EP. Now, there are several different flavors of Linux is available. If you want to use Soucy or Debian, those are also available in this video. I'm just gonna go through and install this, so I'm gonna just go ahead and say, install, click on install button and it is actually asking me to sign into Microsoft. I do not have an account with Microsoft, but it is gonna go through the process of installing anyway, So I'm just gonna close that you can see here it is actually downloading in the background so that a little sign and is a little misleading. You really don't need to have a Microsoft store up. If you do, you're more than welcome Sign and I do not have one and it is not needed to complete the installation. So you can see now going to just got installed. I got a notification down on the bottom. I can close out the Microsoft store, you know, to see a boon to I just come up here and click on a boon to, and it's going to take a second to go ahead and complete the installation so you can see here it is asking you to enter in a new UNIX user name, and I'm just going to use my initials of J T and head honor. That's asking me for a password. I'm going to provide a password confirmation of the password, and now we can see that this is installed correctly. So I just do an LS here. Pwd. So now you can see that I'm in my home directory all installed and that pause at first where it's doing the insulation. That is just a one time set up where it's going through initializing the a boon to environment. If I I think I can click exit here, just say exit So that exits the application And the next time that I want to run a boon to or ghetto Basho I can just say here and I am at ah Basho and then just as an alternative this is one way to get to the bash Shell is just by coming up hear clicking and saying a boot to If I happen to be in the command line So if I'm using the command prompt here if I'm just in that and I want to get to Basho But in the directory that I am, I can just do the command bash and hit Enter and you can see Now I am actually running a basho and I can say l s P D V d and I have all the normal bash shell commands that come with the in boo to environment At this point, Ah boon to is now installed under the Windows Lennox subsystem and available for you. So you have complete access to the boo tune and some of the features of a boot to such as get ssh! And some of the tools that typically do not come with a Windows environment. That's a real handy way to get up and going with the Basho. Previously and previous versions of Windows get to use several different utilities to get Lennox like features. This is actually integrated into the Windows operating system, so it gives you a much better development experience than developing on just Windows itself when you're used to bash Ellen Lennox environments so that now has the clinic subsystem installed on your system. The next step is we need to get Java installed for the Lennox subsystem sets separate insulation step even though again we do have Java installed for Windows itself were running in a subsystem that does not have job install. So we need to go through a quick installation step to get Java set up installed running for the clinic subsystem of Windows 10. So now that we have the Lennox subsystem install, there's actually a couple different ways that we can get to it. Just to recap, we can come up here, click out of boot to, and this is going to take us into a command prompt, and this is actually running within the the clinic subsystem, and you can see here. If I do job, we're saying job was not found. No, if I come up here and get to the Windows Command mine and this should work on their power, Schellas. Well, let's see. You will come up here. And if I do Java like so you see that I'm getting a much different air message. We can see that the Java executable is being found because if I do version, we will get a response. So you can see there that I have Job 11 installed. So here, under this, I'm going to go ahead and install using pseudo app. So this is the clinics installer, and you can see that it's actually tell me exactly what I need to install. So I'm just gonna follow that command. And this will set up the open J D. K. Version. So remember, under the Windows operating system, we installed the Oracle version here. I'm just gonna go ahead and use the open J d. K. So I'm gonna say pseudo app install and we'll say open J d k national 11. I'm as J R E. And we will do headless and headless means that the system will only has. It doesn't have AH monitor or video card or anything like that. So it's only expecting to be run in a server type mode. So again, like Amanda's Sudo apt, install open J D K dash of 11 desh J R. E. And actually I want J. D. K. So I'm gonna back that up, say J D k, and say headless. Now it's asking for my password and you can see it that it goes through there and it's going through scanning what it needs. And it's telling me that it's going consume 378 of additional disk and I'm going to say yes and hit Enter. And now is going through downloading it, installing it. You know that saying that it failed. So here I want to do pseudo Ron. Yeah, get update. I'm sorry, Sudo Apt! Get update now I can I'm just sitting in a barrow toe. Go back through and I'm gonna go ahead and saw that Yes, and now after Iran, the update you can see now it is downloading the JK 11 headless and we're seeing a little bit of a different result here as it's going through installing the various packages. And this is all for the Lennox environment that is, installing a number of libraries and whatnot that it needs for not only the J R E, which is a Java runtime, but also the J T K, which is the Java development kit for open J. D. K. And the speed of the since relations going very based on the speed of your Internet connection as well as your system. Now you can see this is completely installed. And now if I do which job you see that is coming back to user been Java and I can issue a Command Java version that tells me that the open J T. K and this is the jbm Java runtime. And if I do which Java Sea that tells me the Java compiler, you can see that I have the Java compiler and I can say Java Sea version like so and he's gonna give me back the Java compiler versions of the second step tells me that the Java J D . K. Has been installed on the system, said this point. Now I have the Oracle Java installed under Windows 10 under the Windows 10 operating system and within the limits subsystem. I have opened J T. K installed for the Job Development Kit version 10. Introduction to Java Programming: Okay, At this point in the course, he should have your job development environment all set up. So if you do not, if you have not set up your J. D. K stop and go back to the previous section of the course is very important for you. Proceed with course. At this point, you need to have your job, a development environment set up so that you can actually co java. So we're gonna proceed using the intelligent E i d, which you should have installed and also the J. D. K. So we can start cutting jobless in this section of the course. What we're gonna be looking at is just some of the fundamentals of the Java programming language. So gonna be a little boring That not too bad. I'm gonna try to keep it is intended as entertaining as I can make it. But here we're gonna be learning the very, very fundamentals of the Java programming language. Just the basic constructs in the basic syntax and how Java programs actually worked. How you start coating them, so we're just gonna be looking at the very, very basics. But these are all fundamentals. We need to lay down that tunnel fundamental foundation s so that we can start building up on top of that. So this is really cornerstone content of how we start developing job applications. So very, very basic, but also very, very important, because this is stuff that you need to learn and master so that we can build upon it as we progress through the course of, we're going to jump in and start looking at developing job programs. 11. Anatomy of a Java Program: in this Java programming tutorial, we're gonna look at the anatomy of a Java program, the smallest building blocks of Java programs air called methods. A method is a piece of code, which is asked to do something to help you envision what a Methodist think about an A t M. The team is gonna have buttons, which one pressed in the right sequence and conditions will dispense cash. For example, we could have a method to check if the card is inserted. A method to check the PIN number entered a method to get the account balance or to dispense cash methods can accept input values such as a pin number, and methods can also return values such as an account balance. The declaration of a method starts with a return type. This says. What the method will return back to the caller of the method. Now void is a special Java keyword, which means the method does not return a value. We will cover additional Java Q words later. In this course. Next is the name of the method. The method name should be something descriptive, such as card removed. Also in Java, it is a common convention to begin your method name with a lower case letter and use camel case, meaning that the words in the name are capitalized after the name of the method are parentheses. Within these, we declare any values that we want to pass into the method, if any, these air completely optional. Now the values that are passed into a method are called method arguments. Next is the opening curly bracket. A Java programming convention is toe have the opening bracket on the same line as the method name. Other programming languages prefer to have the opening bracket on the following line. Next is the closing bracket. The opening and closing brackets contain one or more statements which make up the body of the method. While there is no limit to the number of statements a method may contain, it is considered a best practice to limit the number of statements to about a screenful of code or roughly about 25 lines. This will help you write higher quality coat. All Java applications have a special method called main. The main method Tulsa jbm to start here it is an entry 0.4 year Java program. Every Java program will have at least one main method. We will explore the main method further into the course. Just remembered, the Java program will have at least one main method and it is the starting point for the program with Java. Methods will belong to a class. Think of a class as a container for related methods. Continuing to use the A. T. M. Example, We might have an A T M class with methods for things like validate, pen, get account balance or withdraw money. These air all related methods to a single class to declare a class in Java, we use the Java keyword class, followed by the class name like methods. Class names should be descriptive about what the class is. Unlike methods that Java Convention is to begin class names with a capital letter after the class name our pair curly brackets. These brackets will contain one or more methods, and these methods will make up the class body. In Java, classes and methods should have what is called an access modifier. This controls how other classes and methods can access our example class and methods. Here we will use the Java keyword public to allow access to both our Java class and method access modifiers are an important topic which we will cover fully later in this course. Finally, Java classes should belong to a package. Think of a package as a container for related Java classes. The package also becomes part of the Java class name in large job applications. Using packages helps to keep the class names unique. A Java convention is to use your reverse domain name. For example, I owned the domain spring framework DOT guru, so my packages are guru dot spring framework. 12. Your First Java Program: in this video, we're going to show you how to create your very first Java program. So if you've done any development in the past, typically a very first step is to do Hello, world. So that's exactly what we're gonna do in this video. If you've never done a hello world, don't worry. This is a very common ups exercise when we're getting used to a new language. So our objective here is to right a joke Java program that's gonna output hello world to the council. Very, very simple application. But this tells us a couple things. One that you can actually write a Java program and get a little success with it. And to that, you have your environment properly set up for Java. Now, if you have not done so already, you need to have the Java J T. K installed on your system. Previously in the course we went through that. I have installation videos for Windows 10 Mac OS and also Lennox. So if you are using well those flavors, you need to have those done. So you need to have the Java Jerry installed the job J. D. K. Installed and we will be using intelligence, so that also needs to be present installed on your system. I've covered those previously. If you have not done any that you must get those installed. Otherwise, everything actually in this video is not going to work. No. And this step, we're gonna show you how to create a brand new project using intel. Ajay, after you start intelligent, if you have not done anything before, I didn't have any open projects or whatnot. It will come to the screen right here. So this is a menu where intelligent doesn't have any projects open. And it's giving you the option to create a new project, importer project or open one or get one from source control. And in this example here, we want to go through and create a new project. So I'm gonna just click on, Create New Project, and now you can see I have a menu up here giving me a number of different options from Java , Java FX maven, Gradel, groovy catlin, or just an empty project. And if you've installed and trying out until J Ultimate, you will have additional options here. We're not going to cover those, but the one that we want is Java. And also make sure that you have the Java J T K selected. If it's not selected or the wrong one that's selected, change it here. And if you need to, you can click on the new button to telling to tell a J where your J. D. K. Is installed. But he shouldn't have to do that if everything's been set up. As I showed you how to just make sure that we have Java in the project SdK software development kit is selected and we'll just click next and that there are a couple different things that we can do. One is a command line at we are just gonna do a very generic Java application, and all we gotta do is say next year. And it is going to default to your home in your home directory to idea projects, and I'm just gonna call it my first project like so and then click on the finish button and it's going to take it a second to open up. And typically you're going to see tips of the day and that these air actually kind of handy if you are new to Intel. Ajay, this will tell you a lot of little features that are very nice. And I've been working with intelligent for a long time, and I'll pay attention these because I'm always learning new features of intelligent because there's a lot to it. So I'm just gonna close out this tip of the day. You might have a second or two for the screen to come up because what intelligence is gonna do is go through and build an initial index, and depending on your speedier system, that can take just a few seconds or might take 30 or 40 seconds where you don't see the screen yet. So now this has created the project so you can see the project is now created. Says my first project shows me the path where it is on my system. This folder here dot idea that is a hidden folder, and that's internal working files for intelligent itself. So we never have to look in there. I'm just gonna close that out. S R. C. That is the source folder. That is where any class files are going to go. Anything that we're developing which job are programming files. We go in there and then this my first project. I am out that it's also an intelligent file. So that is the intelligent project file for this project. Now, of course, we will be using intelligent quite a bit more. I do want to pause, just pump the brakes a little bit and take a look at some very common features. Intelligent because I know some of you might be brand new dental. Ajay, we're just going to take a quick look at some very common features of what intelligent has toe offer and why it is one of the top Java integrated development environments out there somewhere. And jump over, take a look at some features, and then after that, we'll get into creating our first Java program. In this video, we're gonna do a quick review of some of the features of intelligent. Just get used to the landscape here a little bit no. One. The first things that we want to take a look at is preferences and the preferences. I think under Windows it's gonna be under file. I could be wrong about that. And here you're gonna have appearance and behaviour. Remember, we had the theme that I said when we installed everything, you change the theme of that. So this is one area where you could adjust the theme you can set menus and tool bars. There's a number of different things that we can set up here. As far as your editor, you can change the font and size a lot of different options here, for example, there's ongoing battle with developers, I think, for indentation. Should he either you spaces or tabs? I'm not going to get into that, I think spaces personally, but you can configure the I D for a number of different options. I'm not gonna be able to go through everything here as far as options, but one very important place is plug ins. Intelligent does have a very robust plug in environment. So as you grow as a Java developer, there's a lot of tools and features that you can add in two intelligent through plug ins. So, for example, I have scallop here. Scala's an alternative jbm language. If I wanted to start developing and Scalia, I have the scalp plug in that I could install and again remember the mortars plug ins that you install the more resource is going take so try to keep it lean and that will help your i d for him better. And right now we have everything installed that we need. So I'm not gonna stall in a additional plug ins and then appear under file. You can open up existing projects, go directly to a project open up. Here's a recent projects closed existing project and we can do it different imports and exports. One very important thing that I want to show you here is the invalidate caches. Restart What happens? Remember when we started up the project and there was a little bit of ah, pause there? Well, intelligent was going out indexing the project. Sometimes mistakes happen and then that becomes invalid and intelligence, not finding stuff that it should be fighting. This is something that you can utilize to tell intelligent to go re index. That project do not have to use this very often. We have something strange happening on odd behavior world like intelligence, not finding a Java class that you think it should be. Try this option. Often it'll clear things up. I develop with intelligent nearly every day, and I use this maybe once a month, maybe twice a month, tops. So if you do see something odd happening, this is a place to go now. A couple of other things I want point out to you here is navigate. You can go to specific classes. This allows you to search for things. Very robust search capabilities, the re factoring them menu. Remember, intelligence is toe help with your developer productivity. We will be looking at additional features in here. There's features that help you change and modify your coat. You can also come over here, and these are options to help generate CO. To take away from some of the more mundane task of having type stuff out. Then tell A J can automatically generate things for you, and we'll be seeing that coming up in the class as well. And the other thing is built Project. My knee Java code is going to start off in a text file dot Java go through the Java compiler to a dot class file. This is what does that action. They will take all the Java source files in the source folder and compile those to Java class files. Now build is different than rebuild build is gonna be an incremental build. So it only builds what hasn't been changed It on Lee builds what has changed and skips over what has not changed. Rebuild will go through and delete everything and rebuild the project completely. So build is gonna be a little bit faster than rebuild. That all changes a project. It's larger. And sometimes if you see something weird and builds not behaving properly, you go and just say rebuild, start over and make sure that everything's right run as a dialogue to actually run your Java code V. C s. So this is version control system and we'll see that further down on the course, we'll start working with version control and then help. Remember, we saw the tip of the day. You bring up additional tips and then also here to something. I encourage you to exploring your own demos and screen cast so you can see additional features, more advanced features of intelligence. So this is gonna be information from jetbrains on them, telling about features of intelligent that you can utilize usually pretty good, you'll find out pretty good stuff in those and then key map reference. I am running on Mac OS. So if you're on Windows Mikey mapping is there gonna be a little bit different than Windows and Lennox versions of here? You can click on that and get additional information about the key map ings for your specific operating system. And then remember here we had under build the build project. You have a shortcut for that right here and here. This project structure this is important under project settings. Project that your project name. And if you ever need to change your as decayed, that is where that is. And you can also adjust your language level. There are times where you're gonna be on a different version of Java and only want enable certain language features typical your and be the same then another important one here. His conceit, e sources, intelligence is gonna look under the source folder here for any Java source file. So that's how we were telling it for that. And as we get into the course will talk about adding test and resource is and these these are options. How we tell Intel a J that we want to have these folders or test a different folder for resource is or test resource is or just ignore altogether. So this will configure the behavior of intelligence for different project structures. So that was a very high level overview of intelligent just to get you oriented. As we progress through the course, I will be showing you additional features of intelligent and things that will help you with your productivity and utilize the intelligent e i d. Better Previously on the course we talked about the anatomy of a Java program. So remember, we're gonna have a Java class and within that class are gonna be methods. So in this section, we're going to go through and create our first Java class and add in, ah, method what? We're going to treat this special. We're going to create it as a main method and that main method is going to tell Java This is the entry point for my program and to execute this method. So I'm gonna jump over to intelligent now and show you exactly how to do that. So to create our first class. What we want to do is come in here. We're gonna say, right click and I'm gonna say new Java class. It's called Hello World. Now you can see up the top here says Public class. Hello World. So that is the class decoration, and we have the opening bracket in the closing bracket. Now what we need to do to this is added in the main method. Remember, at a minimum that's gonna take void. Main like so and that sets up the main method. But there's a couple other things that we wanted to to this method here. Maybe we want to set the access modifier to public. We also need to give it the static keyword. So that's another Java keyword. And this basically tells Java that it can run it inside what's called a static context. It is not going to end, Stan. She ate this as an object, and we will be covering that in future modules of the course, but very important for the main method to be static. Because this is basically an entry point where you're telling Java you can just go run this method. Now the next thing we want to do is tell them to take in a string array, so we're going to string and then the square bracket and we'll call that are eggs like so And this is gonna be remember we talked about the method argument. So that is going to be the method arguments for our main methods of at this point here we have a public class called Hello World and has one method on it, and that's called a main method. And that takes in an array of strings of ray of text values and that is gonna get assigned to the variable called our eggs or a RG us. Now, so far, we haven't looked at doing any job. A statements of statements are individual instructions for Java here. What we want to do is tell Java that we want the message. Hello, world output to the council. So what we're gonna have to do is use a Java class and method out of the J. D. K or J R E m e of the Java runtime, and we're going to tell Java that we want a message out to the council. So I'm gonna jump over to intelligent and show you how to utilize Java to output a message to the council. Okay, we're gonna go ahead and write our first statement, and that's gonna be a very simple statement. And we're gonna be calling upon a method from a library, a class that is within the Java Jerry. So what we want to do is use a special class called system and we're gonna do the out and we want to use print line. So the difference between print and print line is print is going to print out to the council. The print line is going to, ah, print and then enter. So it's going to give a line. Feed is the technical term, but thing about we're going to print out a statement and hit enter afterwards. So that was is what the print l and Method is. So we'll go ahead and do that. No, we will say hello world like so Because we're happy that we're saying hello, world. Now, at this point, I can ask intelligent to run it and to execute this from intelligent, this becomes very easy. I'm just going to click right here and I'm gonna say Run Hello. World main and intelligent is gonna go out. You can see down the bottom, There's building, It's gone out and compiled it And we have the output right here on the council. So there is our hello world message and what intelligent did in the background is we can see here we have hello world and now we have under my first project a hello world class. So again, this is the source file You can see here in the tab It says hello world dot Java So this is just a simple text file and here is hello world class That is the compiled by code and we can see that this is what was given to the jbm to execute so intelligent behind the scenes that compiled it using the Java compiler and then said Hey jbm run this program for us and it ran that and we got this out put down in the bottom of the council. Now let's look at a couple common problems you might have If you're trying to run this and you're running into heirs now, one very important thing is right here at the end of the line with semicolon and this is considered a statement. Terminator. This tells Java that this is the end of the statement. Now if I forget that it's really easy. We get a little squiggly here. Ah, red line intelligence saying Hey, there's a problem and we can see appear we have a little red icon in the top right corner and also in the right hand side, we have a red line that's indicating that that's the line with a problem. Now, if I try to run those, we can see here that we haven't air that a semi colons expected, so that that's really easy to forget it. Come in and add in the semi colon. But I forget to close that parentheses again. When he tried to run that I'm actually compiling there. Now we can see that it saying that it's expecting that closing parentheses. I'm gonna add that. And if I forgot a quote, you can see intelligence say, Hey, we got a problem here. You didn't terminate in that string. If I come and try to run it again, we can see unclos string literal. So a number of different problems that can trip you up, my first getting used to java, so we need to have that string closed need to have the parentheses closed, and we need to have that Terminator there so very simple. And keep an eye and intelligent because it will tell you if there's problems. If I did forget that parentheses, if I hover over it, we can see the intelligence saying that is expected. So keep an eye on intelligent because it is going to tell you if there are problems again. This is giving a hint, saying the legal line end and string literal might not make a lot of sense, but you can also see that everything's green to the end. So tell Ajay saying it yet I don't know where the string ends. And if you accidentally had some extra characters in there to that, that could be another problem. You can see right away intelligence popping up, saying, I don't know what you want here. So it's highlighting it in red for a reason. And remember the intelligent E I D. That is there to help make you more productive. So it's gonna be highlighting errors as you go along. So the intelligent I D has been doing a lot for us, making our lives a lot easier because it's been going through taking that job. A source file and running it through the Java compiler to buy coat and then running it. A lot of job developers really don't know how to do that. Say they have to look it up and see how to do this because it happens for us so often we know it's happening, but we I really don't know how to actually do it manually. So I'm gonna show you manually how to take that job. A source file, which is just a text file. We're going to run it through the Java compiler compiler down to buy code and then execute it from the command line so you can see what the intelligent I D is doing for us and get an understanding of how that job a source file would just just text is compiled down to bite coat and then is utilized to output through the JV m. A message to the council. So remember, Intelligent is managing the build for us. It's working with java and background and here under out production. My first project, this is the compiled by code. I'm gonna replicate what intelligent did. So I'm gonna come down here to terminal and open up a command line window. If you're more comfortable, you can open up the back shell or a command line in your operating system. But you do need not navigate to where the project is. So if I come in here and do an LS, you can see that I'm in the project route and I want to see the to the source director and then I do an LS. Now you can see that I've got the hello World Java listed there. So I'm in that that proper directory. So I'm gonna issue the clear command that just clears up the screen and I'm gonna do Java sea. This is the command that's going to compile. It s a minus. D I'm gonna call my out. So my STS for a directory I'm telling the Java compiler to put the compiled files there and here I want to say hello world. So I did Hee e and then Tab and Tabas Auto complete side automatically completed for me from the command line and that s ah bash shell feature. So I'm just gonna go ahead and enter at this point, takes a second and when we do an L us and Now you can see that I have a my out there. So if I see the to my out now, we can see that I have a hello world class. So here the solo world job of that is my source file. Now I have a subdirectory there, and that is called Hello, world class. Now to actually run that when you do it clear here that this command just clears the screen . No, you do java. I'm gonna do command called class path. This tells Java where to look. I'm gonna do the dot notation that says toe, look in this current directory and I'm gonna do hello world class. So I'm telling Java toe, look in this directory for a class file called Hello World Class. I'm gonna hit enter and you could say it could not find main class. Easy mistake. Make a put in the file extension there. I do not want the file extension. So I added in the file extension. Now it's can't can't find that it's looking for a class called Hello World that class And that's on easy air to make I want to do just hello world So now hit Enter like so and we can see that it ran that output. So did the exact same thing is that we did through the i. D. Here through two commands. One was the Java Sea Command that compiled it down. Tobiko put in this directory called my out and then the 2nd 1 Java that is telling the jbm to execute this Java class. And I got the output to the council. So I made a CD dot dot that is going to take me back to the source directory. Clear this and I want to clean up my workspace. So I'm going to delete that my out so that commanders are m minus r f or removing follow. And I'm going to say my out hit enter. No, not compile Directory is now removed from my source code directory. So I was just going through this for demo. Typically, you do now on mix your source files with your compiled files can see how intelligent he has a directory for source and it has a directory for out. I've violated that convention as I was working through this. So to get rid of the terminal window, I could just type exit and that closes out the terminal window 13. Java Key Word Identifiers: this video. We're gonna talk about Java keywords and identify IRS. Now. Java keywords is a word in Java that has some type of special meaning to the language. We've already seen some examples, such as public class, void static, these all our terms that have special meaning and special place inside of the programming language. Syntex. Now these words are reserved by the Java language, meaning that you cannot use them outside of their intended purpose, for example, and you cannot make a method called void of the Java compiler would smack that right down. Right now, there are 51 keywords inside of Java, two of which are not in use. And then there's a couple special cases with identify IRS. So let's take a look at these key words. Here these air A list of the Java keywords. These are all things that you cannot use for things like class names, variable names, method names, not very happy about it. Now in the lower right hand side. You see, I have a bold other that is not a keyword, but the words below it do have special meaning. The true false and all those are liberals for values. So if a variable can be true or false, orginal and then var is a special key word that was introduced into Javal. 11. Introduce that. So that is basically an object type where the compiler can infer the type and will be getting into things like that in the future. Just remember, these are all words that you cannot use for naming of Java. Identify IRS. No job down fire some cells, these air names that you define it when you're programming and they're gonna be for things like class names, methods, variable names, constant names, package names pretty much anything that you as a developer are going to assign a name to in your program. Another is no pragmatic max length. It's over 65,000 might even be higher than that in Java. 11. You better not be naming a 10,000 name variable inside a java that be absolutely crazy. There's absolutely no reason to that so pragmatically, there's no maximum length the other role. Other night Donna fires that cannot be a keyword. So, under valid examples here, these are all valid examples of identify IRS within job. But these could be class names variable names, constant names, package names. So these are all valid things to job. Now let's take a look at some of the rules for naming them. These identify IRS. They can be any upper or lower case letter, so that's a letter between a dizzy or capital a dizzy or a number value from 0 to 9. So anything in there and then they can also use the underscore and dollar. Sign any combination of these air. Fine. Keep in mind they are case sensitive. So if you change case, they will be different. Identifies to the Java programming language. Now they cannot have spaces or any other special characters. Have a couple examples there on the slide deck. That is not an inclusive list. There are other special characters. It is strictly limited to letters. Numbers underscore Dollar sign. Now these air the general rules for identifiers. There are several commonly accepted conventions. Class names should be what's called Pascal Case. This is basically camel case with a starting capital, and we're very seen Camel case used so that that is going to be where you are capitalizing . Any keyword in a string now constants what you see in the Java programming language is to use upper case separated with underscore. So I have an example there. My underscore. Constant underscore name and then packages are all lower case. Reverse domain name is preferred. Now, I do want to point out these air conventions. They're not necessarily enforced by the programming language. So a lot of times you probably could get away with violating these and number of different use cases. Not necessarily good idea to do in my work in one place and might not working another. So make it you in trouble if you try to violate any thes commonly accepted conventions, So I would not recommend doing that so you can see overall within the Java programming language when you are naming identify IRS, you do have quite a bit of flexibility and coming up with names that have meaning to you as a developer, and you should be choosing names that do bring value rather than short abbreviations that nobody can remember what they mean. 14. Introduction to Java Variables: in this video, we're gonna be talking about job of variables. Now variable is something that is exactly like what it sounds. It is something that can vary. That is a value which can be assigned and also changed. For example, account might start at zero and then be in communities time. Some type of event happens. Variable decoration is how you say what the type of the variable is, and it's identify, for example, you might have some type and a variable name of my variable name so that that some type could be any valid Jaffa type. And then variable assignment is how you assign a value to the declared variable, and you can see an example to my variable name. I'm assigning the value of 123 The first time a value is assigned Variable is called initializing. A variable and very common practice is to define the variable and initialize it in a single statement. Now values could be a sign of variables a number of different ways to be sime explicitly by value. It can be consigned by an expression. It could be a sign from another variable itself, or it can also be a sign from the value returned by a method. Now variables can be defined within methods or at the class level within the method is called method level scope. However, if is defined in the class level, this is called member level scope, and this is one of those favorite interviewer questions, too. Now, variables can be used with the keyword final to prevent that variable from changing after it is initialized. It's very important feature of Java now. Java also does not have a formal construct for defining Constance is some languages do. However, we can achieve the same effect by using the modifier, static and final. That effectively will give us a constant. And a lot of people will call this a constant even though job but does not have a formal construct for defining constants. Now let's jump over to ontology and take a look at variable examples. In this video, we're gonna go through and do some examples of job of variables so you can see that I have the previous example from hello world there up on the screen. So what I'm gonna do now is I'm gonna come over here, create a new class and we will call this job variables and we're going to the same thing that we did previously. So now we're declaring that it's Ah, Java variables. I'm going to show you a short cut so we can do PSV for the main method declaration. So I'm just going to get hit, enter here and can see that intel Ajay rated the main method for us. So now, to declare a variable, we can do the type of i N t. Which is an imager, which is a whole number without, it's a number without any decimal places. And I'm gonna call this two line and I just turned it with the semicolon. So that's the line on there. And this is now created that variable. So I have declared the variable to line. Now in the second line, I'm gonna say to line equals two like so and that is the assignment and also the initialization of the two line variable. And if I want to do another shortcut, I can do that out for system out and just hit enter. And now I get that output call, and I could say to line like so, no, if I run this. We can see the output in the bottom window. There is now too. So that is a two line variable declaration. Now we can do this all in one line, so I'm going to end again. That is the variable type. We'll call one line and we'll say that equals one again. We need the semi colon. So if I change their output toe one line like so, we will be able to see the output. Now we can see that output has changed. A one resize this a little bit now we can also do and and I'm going to say don't do this equals one comma. Now, this example here, I'm showing you that you didn't clear and initialize multiple variables on one line, separated by a colon. But people really don't like doing this. And I don't prefer this. And if you're working with other developers on the project, they're probably not gonna like that either, because what happens here, people consider this not very readable. So I wanted Teoh make you aware that you could do it. But generally other developers, if they're looking at your coat, are not gonna like that because this is not considered very readable. So I'm just gonna go ahead and delete that. And I do want to show you that you can reassign variable. So online five there, the one line variable have assigned that a value of one. And I can say here 19 equals six and had a semi colon there. And now if I hit, compile are run. I'm sorry. We can see that the one line output is now six. And I can also say that one line equals two lines. So here I am reassigning one line to the value of the two line variable. So now if I help with that, we will see that the output of the window is now too. So the one line variable equal to and we got down to that system out print line statement now against also say it from expression equals two plus three and give her that space there . And now I can change this to from expression. And when I run this in the bottom window, we can see that I will get now put a five because two plus three equals five. Now, another thing I can try to do if I do final the keyword final and call his final far equals because 10. Now I can I'll put that when I run this I'll get now put of 10. But if I want come up here and say that is now equal to 12 you can see here that I'm getting a squiggly And even if I do try to run, this can see in the bottom Down on the bottom window here, I'm getting an error. So this is a compiler air saying, Hey, you can't reassign that. So, Mrs how that final keyword works. So if I try to change the value of that once it's been initialized, can't do that compilers not gonna let me do that. So many clothes, clothes, that bottom window there. And let me get rid of this. I'm gonna get rid of this reassignment and let's create another method. So I'm going to see public static, and we will be covering the use of the static word shortly and another lesson, and I'm gonna say, Get that So I mean, declaring another method, and here I'm gonna declare clear another variable. Within that method, I'm gonna call this methods go equals, say 22 on that. And here I want return, Return that variable. So this method get in Ah is going to return back and an injury is gonna be returned back that variable methods, methods go. And here, if I say then my var equals so online. Nine There what I'm doing saying that my variable equals the value from the get in method. So if I come up here and I'm gonna change our output to use the my bar and now what? I run this, we can see that the output is 22. Resize this a little bit now. What I cannot do here is I cannot say Sequels method because what's happening here Put an equal sign there. What's happening here is on y nine. I'm declaring my far method scope. That method scope invariable only exist in the context of this method, so I can't get to it outside of that method. So here, if I try to run this, the compiler would throw on Aaron is it is not going to be happy about that at all. If I tried toe run that so I'm just going to get rid of that But, uh, I'm just going to leave that altogether. No. One last thing that we want to talk about his member variables so I could come up here. It's a static and and this is a member variable. Remember that? That is Ah, favorite interview question. It's a member of our egos. 123 Now I can use that in my method because that variable belongs to the scope of this entire class of any method in the class can access that member variable. That's why they called a a member variable. So now if I run this, we'll see that the output changes toe 123 so that that's very important. And also from that I can also say And my interview fire equals member of our that actually they say, member of our plus turn. And now if I put up do the output of my inner variable and I run this, you can see that I get 1 33 So what's happening here is when I declare this variable, enter Vier. I'm saying that equals member of our plus 10 so you can see down in the bottom window I get 133 output it so that there's a number of different ways that we take unclear variables and also manage those variables. And you can see that we can change those values when we need to when we're running within our code and we can also prevent changes to those variables using the final key word. And we've shown you a lot here in this video, and we will definitely be working with variables a lot more coming up in the course. 15. Learn About Java Primitives: in this video, we're gonna be talking about Java. Primitive types know exactly what our job of primitives. These are special types that are very efficient. They're actually the most efficient variable type to use. Java stores primitive variables directly in memory, so it's very important as to how the job of program is going to be very efficient. That's really does help with the efficiency of processing with Java because of how the primitive values are being stored. It gets him a little bit closer to the native hardware and what not. It allows job but to be much more efficient on the platform that is running out. Non permitted variables use references to where the value starts of this a little bit different. This is really the inner workings of how the JV M is working with these different variable types so that the key takeaways remember that primitives are going to use less memory and also be more efficient to access. So wherever practical you want to be using primitives and I say practical because the reference types can. They do have their benefits and we're going to see quite a bit of reference types coming up but the Primitives are very important part of the Java language, and if you're doing something that is looping and going over things quite a bit, I definitely want to be looking at using printers because of their efficiency. Now here's a list of the Java primitives There's eight different permitted types can see that we have the value for a bowling that is simply true or false. And that takes up one bit memory. Ah, bite that is an imager and that also takes up one bit in memory and see that a bite can have a value of 1 27 and negative 1 28 than a character. This is a Unicode character, so Unicode is a a three Z and then a suite of special characters, and I'll share additional information with that are about that coming up in a different video. But here these air asking value 0 to 2 56 and then a short. This is also a manager, and this takes up two bytes of memory and you see, this is ah, roughly 32,002 negative 32,000 and then an inner jer is like takes up twice the memory that a a short does and you can see I have scientific notation. There is a ah larger value not can't figure out the scientific notation there and then we have a a long this takes eight bytes of memory and with the eight bytes being that it takes a double the memory of an image, er that is gonna held a much larger number. And then finally we have their their cousins floating double these air floating point numbers. So the short end and long these air whole numbers, they don't have a any decimal precision where the floating double do have decimal precision and key Take away there. You can see that the float takes up 32 bits and you could see the scientific notation there , and the double is gonna take up 64 bit. So obviously that's gonna be a much larger number that you can store in that value. Now you can convert data between the different permanent types. This is known as casting. There's two types of casting. One is implicit where the casting is implied. The magnitude the large, larger part of the number is always preserved. But the precision maybe lost a faras the decimals knows could get truncated. So this is gonna happen automatically. You don't have to declare it so if you are going between types and this can happen without your intervention, explicit is where casting has declared. You are explicitly going to declare this, and this is something that you have to be careful with. The skin definitely get you in trouble if you're not paying attention. But it is also handy where you don't need that magnitude to be preserved or you are aware of the consequences of your actions. So just remember that explicit you work going, declare it the magnitude might not be preserved. So think about if you're going from a larger number into a smaller container, you're not going to get the larger value stuffed into their. So just how the application's gonna work. So you go from a long that is taking 64 best into an imager that takes 32 bits. You're gonna wind up with the maximum value of 32 bits. Now let's take a look at the table of the explicit casting. So this gives you an idea where I have unless you take a look at the Ah character going from top to love yet the from Belene bike character and go down to bite. You can see that the character that is a cast operation. So wherever I have a cast operation, this is where you have to do explicit casting. And if there's no value, that's where implicit castings gonna go ahead, go ahead and happen for you. So this is a table that you can print off and keep for your notes and and use it as a reference. Now, the job of primitive types all have corresponding reference types. So, for example, bowling the all lower case bowling type is going to have a reference type in that just starts off with a Capital B again, the character CHR that it's going to also have a corresponding reference type in the same with Manager and so on. I think you can see the pattern there, and just remember that the reference types can be much more costly. They can consume a lot more memory and can be slower to access and reference type. There's a lot of information on those, and we're going to cover that in an upcoming lecture 16. Char And Boolean: in this video, we're going to start taking a closer look at the job of primitive types. Now, Of the eight primitive types, two of them are non America. The others are in America, these air, not numeric. And in this video, we're gonna be looking specifically at the char or character and Belene, which is just her false. Uh, First, we're gonna be looking at the chart type, er character type, and it has got some interesting characteristics, and I'm gonna jump over to intelligent now and do a quick general of the basic features of the char primitive job type. Okay, let's go and take a look at the chart type. And what I'm gonna do here is I'm gonna create a new class. I'm just gonna come over a job class new. I'm gonna call it char examples. Now you're gonna find a zip file of all the source code in the course. Resource is for this lecture, and I'm creating new classes so that you have a reference to go to. So it's going to create that new main file. So PSV em all the the first letters. So I'm just going ahead under there and that creates up that that main method. Now, if you remember, we did. Ah s out, and I'm just gonna do a hello world there now. Hello, world. That text that is in green here, that is actually a string. So that is a job, A string. We haven't talked about strings very much in the course, but that it's actually a string value. And you cannot use that with the chart type. So if we declare a char, remember, we're gonna declare the type for so that's gonna be char. I'm just gonna call. It's my char. And some people first say character, I have a habit saying char for for these types and here rather than the double quotes, very important, you use a single quote, and I'm just going to call that a lower case X. So again, remember what we have going from left to right online four is gonna be the variable type that is C H a r. Then the variable name that is gonna be my chart. And then we're saying that it's equal and four characters. That is very important because it can only have a single character if I try to put into their I can see that intelligence. Tell me right away that is wrong. Or if I come in and use double quotes again, intelligence going tell me that is a wrong assignment. And if I try to compile this, the Java compile. Oh, definitely be unhappy with me. So I'm just gonna come back and say X like that so very important to do the single quotes around chart types. And I come down here and I'm just going Teoh system out and then save my char like So let's go ahead and run this and see the output of it. Then you can see down at the bottom that I am getting at Excel for the My char variable again just toe toe. Reiterate online for that where we're doing. The declaration were doing the variable type of char C H a r, assigning it to variable named my char, and then that variable assignment. Four chart types Air character types must be in single quotes and double quotes or more than one character are definitely not good to use with those the Java compiler will say no , you cannot do that so very important things to remember when you're dealing with the char primitive now one of things that the char character primitive type does support is something called a Unicode. Now Unicode is a very important standard. We're gonna take a little closer. Look at that. What happened? If you think about computers down at the bottom, the very, very, very basics of what's happening there is. You have bits and bytes, so you have eight bits toe bite and a bit is just, ah, binary indicators on or off. And then eight of those make up a bike now that. But it can represent a number of different things. And what happened back way back when going back in computer history is different, characters said, start to be established. So obviously I speak English and deal with the English character set quite frequently. And as things involved, if you look at other character sets such as Chinese, for example, I got older. I. So I look at the Chinese characters. I have no idea. Yes, Rita, because they're so intricate. But you look at those character sets and you look at the different languages that started expanding out the capability. So what was happening as you started getting different character sets that had the same binary meaning. And that did not bode very well for the computer industry. And that's really kind of what led to what Unicode is. So we're going to go over to show you a slide deck now of on Explorer, more about what Unicode is and how that relates to the Java programming language. So let's take a little closer look at what is Unicode. Unicode is a character encoding standard so that this is important. Understand? The character encoding is really a mapping of binary values to human readable values. So we're gonna take a binary value and map that over to a character, basically. So, for example, you can see I've got three examples on the screen there of binary representation. Remember, eight bits bits are gonna be one or zero, so eight of them all together is going to be a bite. And this is the representation of a bite for the letters A, B and C. So these are basically the character and coatings that we're talking about of how these values get mapped over to a character that we see on the screen or in some type of text valuer. That's how put the log that is, what is converting that now? Unicode. There's a lot of different encoding standards. Other. There's dozens of not hundreds, but Unicode is probably the most widely accepted and widely used for these different character encoding standards. Now it started off with three main goals. So the Unicode name is supposed to be for being universal, addressing the needs of all the different world languages. So we've been looking at land languages such as English, where obviously, I'm using English characters on the screen right now. But if we're talking about Chinese characters or Japanese characters or someone Middle Eastern characters quite different from what we see right now, So we're trying to address all the world languages. All all the characters are being used around the world within Unicode and then also uniform fix with codes for efficient access of that, we're using 16 better 32 bit whatnot and then also unique so that the bit sequence on Lee has one interpretation to a character coat so that that was the underlying goals of developing Ah, Unicode. Now it started in 1988 to create a 16 bit database of character coats. That 16 bit space provided room for over 60,000 characters. Now 1991 the first Unicode standard was published, and this is important because the development Java also started in 1991 where 1.0 Java was released in 1996. Coincidentally, ah unico to 0.0 was also released in 1996 and that to doubt zero release expanded the specifications beyond the 16 bits. So John was already down the path of being developed and getting out there. And then we expanded this out to 16 bits. Important to remember that the 16 bit Unicode is called basic and then the 32 bit is called Supplementary Now for Java was part about Java, the primitive char. Her character supports the 16 bit Munich of the basic set of Unicode characters. This was really none to prevent breaking changes, so people are starting to use java as Unicode was becoming more and more important. So the primitive char is going to support the basic, however, has Java releases came out in the reference type that supplements char the corresponding reference straight character will provide the 32 Bit of support for Unicode. So what I want to do now let's jump over intelligent and show you how we can use the Unicode support for the Java primitive of char. And what we'll do is I'm gonna show you on Wikipedia Ah, chart of your co chair characters and how we can interpret those into basically using the Unicode functionality with the character type inside of the job of primitive. So I'm going jump over to intelligent now and show you exactly how to do this. Kato, don't put Unicode Character is what we want to do is we're going to clear a new character, variable. And I'm gonna call this my Unicode like so I'm gonna say equals and we'll do, Ah, empty set of single quotes. Remember, Sink was very important. And the way we specify Unicode characters were going to do slash you. So that's gonna be the slash above your enter key and what we need to do is give it the unicode code. So you might be wanting what that Unicode is. So let me jump over to chrome and show exactly how to look that up. I know here on chrome. I just did a search for Unicode, um, at the Wikipedia page for Unicode and you can read probably far more than you want to know about Unicode on this article. But what's important here is there's a nice reference there. There's actually a number of different references, and this is probably one of the more convenient ones for Unicode. And if you want explore what's inside of Unicode, you can do so here. You can see here I have the basic types up on the left hand side and then all the supplementary characters that have evolved over time. Ah, since back in 1996 when this was originally published. So if I come in here and click on this one, I'm just gonna click on this range here. So that is a hex. Adopt small range and click on that. And now we can see the reference so you can see Here, let me come up here so you can see this is controls and basic Ladn. And let's say I want to use the character A And what's gonna happen is you come down here the U plus, and that's going to say +004 x and that exposition for that X. If we go across this zero through, f is gonna be the X value. So if I want to get an A output, I'm gonna do 004 and then the number one so I want to use is ah, you 0041 to represent a letter A So let's jump over here. I'm going to come back to Intel, Ajay. And remember that was 0041 So I'm gonna do 00 for the number one and let's come up here. I'm gonna do another system out and I'm gonna say my Unicode like, So go ahead and run this now and we can see in the output. I'm getting the letter A So it's come back over to Chrome And let's say that I want to get a lower case. Hey, so that's Sarah 06 X. That is gonna be one. So if I change that toe a six here and run that I should get a lower case A. And you can see there in the output that I am getting a lower case a come back over to chrome and actually let's pick on this, uh, there's our see value. This a with a squiggly over, and I apologize. I do not know what that is called, So let's grab that one. That was gonna be a 00 C and one. So it's gonna get that output I was gonna change to see and still number one. Let's go ahead and run that. And now we can see that I'm getting that A with the tick mark on top of it, showing that extended character support come back over to chrome one more time. And if you scroll through this, you can see that there's a number of characters that are available, and this is all in that basic set. You can see a number of different symbols and characters are available, and I'll let you go ahead and explore that on your own. They come back over to intel, Ajay. And just to reiterate, when you're dealing with Unicode characters, you want that slash slash you that's gonna indicate to Java that you're dealing with the Unicode character and then these characters behind that they need to be a valid Unicode code for that character code, and you can give whatever code you need out of how I showed you how to for reference those reference tables there. Now, last thing I want wicket in this video is the building data type. This is a primitive type, and also there is a corresponding reference type to that long times you're gonna be using this for conditional logic. At this point, I'm just gonna demann demonstrate creating that variable and getting the output. We are going to get into conditional logic coming up in the course. I'm not gonna dress that at this point in time, but we will be getting to that. The bowling data tape is very important for making conditional logic where you want to know if this condition do this, But we will be looking that looking at that in a future video inside this course. Okay, let's take a look at declaring Boolean values so the data type is gonna be just blue lean. And when you are using variables dealing with bullying a lot time you want pose the variable name in question. So let's say is weekday in this case for me, it is false, So I'm just gonna do false like so so I am working on the weekend toe record some content for you guys. And then what I can do here is I can do system out. And here I can say is weekday and I'm doing a space here and I'm gonna do something called concatenation. I'm gonna upend the is weekday value to that. And we can see intelligence. Give me a little warning here saying that it's always falls, which, of course, I know because I'm setting it up also not changing it anywhere. So we will go ahead and run this just to see the output. And here, you see, that is Weekday Falls. And we can also do another one like you want to bowling and let's say is sunny. And in this case, for me, it is true because it is a very sunny day outside. So now I can do system out. Remember? We want oppose that in a question. And one quick trick here is I'm doing a trailing space so that it looks okay on the screen and then I'll just do a plus and say is sunny and we'll go ahead and run that we'll see the council output for that So just in summary, the main thing with a blue leans. It's a good good programming. Have it to declare those variables and in the type of ah ah, question. Because as your coding, when we start getting into conditional logic that is going to make more sense in your mind as you're thinking, Oh, I'm going to say is Weekday, I want to do this. If it is not a week today, I want to do that. So that helps you think through, as you're developing your programming logic, to have these variables in the form of a question. 17. Arithmetic Operators: in this video, we're gonna be taking a look at the arithmetic operators available inside the job of programming language. Obviously, the capability of doing math is a very important part of any programming language Java has . The basics covered definitely has basics covered. And when I want to do now is introduce you to the I think it's five different operators that we have available for doing arithmetic. Basic arithmetic inside the Java programming language, gay up on the screen. I have a A table showing you the Java arithmetic operators and their hope fairly intuitive . So just going from top to bottom, we have the plus sign, so that is going to add A and B together. And we always saw previously in the course we can also use that to concoct innate strings. So we're gonna bring to string values together. And a lot of times when you're dealing with data types, all the data tapes, they're gonna have generally implicit to string functionality. So behind the scenes, Javal converted over to string Can Katyn ate them together, and we saw an example that previously in a lecture on the course, then the next thing that we have is the minus sign and this is going to do subtraction. So this is going to subtract B from a in this case, and then we have the multiplier. That's just a simple ass trick. This guy multiply a times B and then also we have the slash or the division sign. So this is going to divide a by B and then the next one that's a little bit interesting. This is a percent sign and this is gonna be the remainder. So if you do division, remember, you're gonna have ah remainder. If you go back to your basic math classes that you have in school, this is going to show you the remaining value. So there's, uh when you're doing different type of math operations, that's gonna be fairly handy toe to utilize. So these air, the basic Java arithmetic operators gives you all the fundamentals that you need to do basically math inside of Java. As you can see, the operators that we have available for you, sir, are fairly straightforward, fairly intuitive as to how they are used. We've already seen the imager, the permanent type manager I anti and used inside the course So what I'm gonna do now let's show you how these operators are used with the imager to assign different variables and do arithmetic operation. So we'll go through some basic operations introducing you to these arithmetic operators using the end for imager, variable type inside of Java. Let's go and take a look at some examples of doing arithmetic inside of Java and what I'm gonna do here is I'm going to create a new class for your reference and we will call this arithmetic examples like so. And we will add in a main class to this some using the intelligence shortcuts there for that. And let's go ahead and initialize a couple values so we'll declare a manager and we'll just call this, too. And we'll set him equal to two, and we'll do four. Also. Just keep this nice and simple for now. So we have two variables to and for equal to those values, respectively. And let's come up with here. We'll do the end result. Yeah, I will say that that equals to close for like so and let's get the output of that. So I'm gonna dio s out. That's the intelligent shortcut for system out and we'll just print out the results. So let's go ahead and run that now and could see that would get the expected result of six there. Let's come up here and let's come here and say, Well, just redefine the result And now we can say result equals two times four and we're just reassigning the variable results to the multiplication of that. So let's go ahead and run that now. And we could see that as expected, we get eight and let's Dude, I got the minus sign. So let's do Tu minus four and let's get the output of that and that is negative. Two, As we expect now, we do. Result equals for divided by two. Get a nice hole result for that, and we could see that we do get the proper result there Now, Finally, we need to look at the remainder operator. It's ever do. Result equals for percent sign to. In this case, we should get a zero, which is to be expected, and let's do something a little bit interesting to actually get value out of that. So if we do for remainder and say three, like so I should get ah, positive value there and we can see that we do get a one there. So these are the basic arithmetic operators available inside a Java using the energy or the primitive data type. So previously in the course we talked about the energy data type being a whole number, not having decimal places and a specific range. Now we started playing around with the arithmetic operators, but there are some very distinct gouaches, as's faras how this is gonna function with the imager data type and java could be a little unforgiving. So I'm going to jump over to intelligent and show you some of the concerns that you have to have when you are dealing with arithmetic and the constraints around the manager data type . Okay, let's talk about some of the Java couch, especially with the energy data type. And what I'm gonna do here is I'm gonna do a comment. We don't think we talked about common ship and I'm just going to say gouaches here. So that is the double slashes, a single lying comment. We'll talk about comments more coming up in the course. So here I want to talk about some of the gouaches. And if I do and and we'll just call this five equals five. That's pretty, pretty straightforward. Now, if I say result equals five divided by two, obviously this is going to give me a decimal result. And if I run it, what is gonna happen to say we're going to get a whole number return? So the decimal pace places have been truncated out of the result because of the energy data type does not have decimals, but we can also do some more interesting stuff. So if we say, result equals and if we do manager the Capital Imager. So this is the reference type. We do have a property on there for the maximum value of an energy, so we're just going to set our result equal to the maximum value that an energy can hold. And let's go ahead and run that. And now we can see we get this nice whole number, which is as expected, so that is the maximum value that uninjured could have Now. What's interesting is we come in here and say result equals injured Max value plus and we'll just say two plus five plus four are our values there, so we're adding in additional value. So we're going above the maximum value of the energy data type, and he guesses what happens here. Take moment. Guess what's gonna happen to that number because we're exceeding the maximum value of the energy type. Don't let me show you what happens when I go ahead and run that. And what's happening is we're getting in a negative value. So the energy are effectively looped around to the negative values an hour. We're going backwards up so kind of a funny behavior. And if memory serves me right, the Java specifications does not really specify the behavior of what happens when you exceed the, uh, value the maximum value of a manager. So this behavior could change between implementation. So if you're running a different job, I have limitations. You could get badness happen here. So be very where it is your responsibility as a developer to make sure that you're not exceeding the values, the allowable values for those energy types or any of the primitive types that we're dealing with here. So we'll be exploring this more. But this is a very important gadget because you can see here in this ran Java looped around didn't complain at all. And if you are running a program, this could really throw a quite a bug into your system. So be aware that the imagers and different permitted types do have a maximum value. And here we were seeing what coined the term predictable result. But reality is this is an unpredictable result, and it's something that you need to guard for when you're developing with the Java programming language. 18. Java Unary Operators: in this video, we're gonna be taking a look at Jabba's you numerary operators. So the university operator is basically on operator that is going to operate on an operation variable on just one variable. So it's gonna be very specific. So we saw previously the arithmetic operators operated on two variables that did operations involving two variables to bring them together and some ah, way Here, this works on one. And, uh, when I first saw this when I was a new developer at first saw these one, that's gonna clever. So they do have some clever functionality. There are some important aspects that you need to learn about them, but they can be very handy and useful when you are programming and Java. So the first thing I want to do is go over and just take a look at the funerary operators that we have available to us. I'm gonna do that through a slide presentation now, So open the screen here. I have a list of the Java unitary operators and you can see that there's five operators that we're dealing with, and I'm just gonna discuss what's available here inside a Java programming language so the first operator minus sign. The way you use that issue, put it in front of a variable so just minus variable name, and this is going to negate the value. It's very much like doing a times minus one on it. So if the variable is negative, it's gonna flip positive. If it is positive, it will foot negative. So very, very important behavior of that. Now the plus operator, this indicates a positive value. This one contribute up. You might expect similar functionality to the minus operator, where it would flip a negative value to a positive. It does not, so that there's a very easy mistake to make, inferring that I'm not quite sure why the Java programming language implemented that way, just presenting out you how it actually did that. So the next to are very important but similar. The plus plus is going to incremental value by one and the minus minus very important there on the screen there, it looks like just one long line that it's actually two minus signs so minus minus. Variable name is going to deck Ament the value by one so that will subtract one from the value and what's important here. You can see that they can be used in front of the variable or after the variable. Now if they air within a statement. Arithmetic statement if they're part of statement on the plus plus operator before, is going to be action before this statement is evaluated so that value would change before that arithmetic statement is evaluated, the then the statement itself will be evaluated. If it is after the statement is going to be evaluated first with the current value of that variable, then after that statement has evaluated the variable get change, so probably nettle. If you're seeing it in your mind here of what's happening very important to realize before the variable the variable gets changed before the statement. If after the variable the variable guests change after this statement and coming up shortly , we'll have a demonstration of this inside of intelligent. I think that will help clear it up when you see actually how this does behave in a coding environment. Next we have the explanation point, so this is very important dealing with Boolean values. So what it does is if the bowling value is true, is going to flip it to false. And likewise, if the value is false, it will flip it to true. And so the explanation point or I like to call it the bang sign. This is basically going to flip or invert a bowling value very handy. We'll see a couple examples of it, and coating is ample coming up, and we will definitely be seeing this further on in the course. It's actually frequently used inside the Java programming language. It is a very handy thing to have just remember the explanation point. Well, flip a bowling value. So if you could see the unitary operators say we have within the Java programming language are pretty straightforward as far as their descriptions. And I'm sure looking at the slide deck there, you're going totally understandable. So what I'm gonna do now is I want jump over to intelligence, show you some demonstrations of how these operators actually work. I think it will clear up a lot of fuzziness that you may have, because the news operators are an important aspect of the Java programming language and they are very handy to use. So I'm going to go over to intelligent no and show you how these air used using very votes , the energy variable. And we will use these operators to operate on variables. And I'll show you how they can affect the outcome of a program statement. And I'll do that inside of intelligence right now. Gain this video. We're going to be going through Java unitary operators. So I want to bring something back. We learned about early in the course, and that is Java packages. So what? Right now, everything is sitting in the root and not a very good habits. So what I'm gonna do here is I'm gonna come in, say, right Click and I'm going to say new package And remember, convention and job A is to use theory, reverse domain name. So I own the domain Spring framework guru so long into his guru dot spring framework In here, I'm just going to create a package called examples like so? So that that was my new package. And now let's come in here. I'm going to create a new job, a class, and we'll call that, you know, very operators, like so so that that's my new class. And what you can see here is now I have a package declaration of Goure spring framework examples. So if I come back to the arithmetic can see top line, there is no package declarations so very important aspect to the Java class of now. I have a package called goober dot spring framework dot examples. And this here, even though this looks like one line, if you go to the file system and look these air separate folders, So under the source directory, I'm gonna have a directory called Guru. And within that, I'm gonna have spring framework. And within that directory, I will have examples. And right here, right out at the top of the screen there, where you can see my first project. We have the source holder. You can actually see the little folders there. So you got source Guru Spring Flammer examples. So in the file system, Nis earthy folders or directories that everything is contained it. So let's go ahead and start taking a look at what we have for examples within, you know, very operators. So the first thing I'm gonna do is come in and create the main class. So it's come in and say public static avoid main. So I'm just typing out the first initials. Their intelligence is gonna do the auto complete. I'm gonna hit, enter, create the main class that must create imager and will call this 15 And let's do Ah, negative energy will call that night too. It was minus two, like so. And let's do ah, man Gero of a result and all we will do here is take five plus negative too. So? So I was gonna give our result. And let's do system out like so. And what we will do is create a string before and I'm doing little space there and I'm using the plus sign that's going can captain eight and let's do and say do five and then we'll also say because and you can see I'm doing multiple plus signs here, some contending together. Ah, longer strength plus negative too. And we want negative two in there and must also show the result and no sound putting spaces within the string so that I get the proper output in the council. And what I want to hear is also when you set this up is between these two statements I just didn't cut and paste there. And I'm gonna call this one after I think so and not know if I run this. I want to show you the output before we do start working with any of the unitary operators . So now we can see before and after. So how I see the same we haven't modified any of the variables yet, so let's start using the unitary operators to modify those. So let's say negative too equals my ass neg to So here what I'm doing, I'm doing a reassignment. So I'm taking the negative two and doing reassignment so effectively going to be multiplying that by negative one. So I'm gonna run this again and down in the council, we can see that the result has changed. You see, I do have one air there because the result that you did not change and what I need to do is basically, repeat this operation cause the *** to variable has changed the I'm just gonna copy that and put it right here. So that runs after. So we'll reassign the result to the current variables of five and negative too. So let's run that again one more time and we'll see that the result value has in fact, changed. So exactly what we're looking for. So before five was equal, five negative two is equal negative to and the result equal three now five has five negative. Two has been changed to positive two. So the result of seven. So I'm gonna do here. This is gonna be checked into the course Resource is for you. And let's run a couple scenarios here. I'm going to comment this line out and must reassign five equals negative five, like so? So we're gonna reassign that using the negative, you know, very operator. And now let's go ahead and run this again. And now we can see that five changed negative five, and our result changes to negative seven. So let's go ahead and comment that one out. I'm gonna leave these comments in their second See these different scenarios if you pull down the source code from the course resources. Now let's take a look at the plus operator. So what? I'm gonna do it here as let's take the negative too. Equals plus negative, too. Now, let's take a look at the result here, and I want to demonstrate something very important now we can see you don't put in a plus sign in front of negative to negative two stays negative. So very, very important. That plus sign there is kind of misleading. So if you put it in front of ah, plus value are a positive value stays positive if you put it in front of, ah, negative value that stays negative. So I'm not quite sure what the thinking is behind that because does its presence there does come say that Hey, And while flip this to the positive, it does not in fact work that way. So it just kind of indicates intention. I guess so. Very easy to think that that plus operator is going to flip to a negative. However it does not. We can see there from the result that negative to with the plus operator did stay negative . So I'm just gonna comment that one out. And now let's take a look at that plus plus operator. So if I come in here and I do five and I do plus plus, what's gonna happen, there is we're going to see that five is gonna get implemented and so five goes to six result goes to four, and in this situation here, it does not matter where I put that. So I could put out either comment that line out, and we can see that the result in this case stays the same, however, become of that out. If I come down here in this statement and I run it there, some running it before we can see that five increments to six, and then the evaluation is evaluated, and so six minus two equals four. However, I put it afterwards, that's very important, I put it after. Let's go ahead and run it and see the results. Now we can see that the statement was evaluated first, and then the variable five was implemented, so it did get implemented. But the results of this arithmetic statement gets evaluated first. The increment happens after, and that is all done based on whether or not that plus plus is in front of it or after, and the minus minus works is saying we can demonstrate that here, let's put the minus minus in front of negative, too, and run that So this is going to run before the statement is evaluated so we can see that the result does change, so five minus three equals two. So here I want to be very clear when the statement runs because of Plus plus is after the five stays at five, however, with negative, too, because theme minus minus is in front of it. It it gets deck amended by one, so that goes from negative to to negative three. Statement is evaluated. Then it comes back and the variable five is implemented because the plus plus is trailing so very, very important distinction. If you don't understand this, you can definitely get yourself in trouble. Very easy to make mistakes. So very, very important to be cognitive of this and this is another favored interview question toe. Understand how these operators work now that the last thing that we want to talk about here is the Boolean operator? So let's do no. Some just can't create an extra statement here, and we'll save Lean Se is awesome equals false like so, and I missed a semicolon. Don't forget that semicolon is very important and I'm just doing system out on her and what it is awesome and that end is awesome. And let's go ahead and run this like that and we'll see that is awesome. Stays falls. However, if I do the bang or explanation point in front of is awesome. Go ahead and run that now we could see is awesome. Flipped a true and and likewise, if I'd start off it true and use that, uh, explanation point in front of it, it would flip to the other way so pretty, pretty handy way to change the value of a bowling variable. So it here have given you a number of different examples. If you're unsure about anything right out this code, run some experiments. See how these urinary operators work against variables. It's helpful to just go through it. If you're wondering about something, how does it work in this situation? Go ahead and write a little code to test it out. See if you have any doubts. Go ahead and write code and and see what happens. Experiment with it. Give it a try and again that the source code for these examples here you can see how my comment things out as I went did that intentionally so that you have these working examples in the source code that's gonna be available inside the course resources 19. Introduction to Debugging: now, as you develop Java programs, things were not always gonna work out as you think they will. And there's a process called debugging to go through your code and see what's happening. And in this video, what I want to do is introduce you to some of the debugging tools that we have available to us as Java developers. First thing I'm gonna do is jump over to intel. Ajay, we're gonna write Ah, really simple application that we can use to start exploring how we can debug our Java code gays. We work through our debugging example. The first thing I wanna do is create a little application for us to work with Somebody come up here creating New Java class and we will just call this debug example like so. And I'm gonna add in ah, main class to that. I'm just using the intelligence shortcut there to create the main class and the example. I want to work with this, like calculating the square foot for a house. So let's start off with house square foot like so, and we will initialize that 20 and let's say that I have a living room and we will say that room is 20 by 18 and here we can say that the house square feet it is going to equal the living room like so, So that no reset the house square footage to the square footage of the living room. And let's say I have a bedroom. The bedroom one. Yeah, I will say smaller room 14 by 15 can hear. What we're gonna do is say the house square feet equals the house square feet plus the bedroom, like so say of another bedroom here bedroom, too. And we'll make this a little bit bigger bedroom and again we'll add that into the house. Square feet. So and here we want the house square feet first that actually the order doesn't matter. Yes, don't do it. Putting that in order just for consistency. And let's give our house also bathroom again. We're going to reset our house square feet toe. How the current house square feet plus the value of the bathroom. So pretty simple little application here that we have just gonna be adding up some numbers and at the end, what's Ah output are square footage like so And actually I can dressed us up a little bit. I can say like that and add that end together. So now what? I run this. I'll get output of the current value of the house square footage. And here the entire purpose of this application is just shows how we are stepping through and resetting that house square footage and we're adding to it the values of the different rooms that we've created as we went along. So this is gonna be our example that we will use for debugging Now that we have our little job application developed, I want to show you how we can debug it. First, I'm going to show you the wrong way. Teoh debug your coat. Now that this is actually you see this commonly a lot of people are going to use this technique of using system out to debug their code. And I'm gonna show you a couple examples here of the wrong way to debug your Java code and then we'll get to the right way. Okay, I've got the example application up on the screen and what you see, a lot of people do for debugging is exactly what we've been using as the council output. And I am just gonna grab this line year and you will see people go in and modify their code . Something like this. They'll add this in and they'll do like number one like that. Then come up here and this to track wherever the house square feet is changing in the applications of they might do something like this toe indicate the output of where the output is coming in their application. So I'm just going through here, adding in numbers and numbering the output. And this would become number four like so And now when I run this, this is kind of how some developers would do this so they would add in the system output in number, the output. So now they can see how that house square footage is actually changing as their application runs. So this is a very poor way, too. And I'm saying in air quotes to debug your program, there are actually tools inside of intelligent that will help us out with us. But you still see ah, lot of developers will go and deep hugged their code exactly like this. So using system out is the wrong way to debug your Java code, but I'm guilty of it as well. If I need to do something quick to see a value, I will definitely go back then use system out. So I don't always practice exactly what I preach. However intelligent does have a very robust ah tool set for debugging coats. I want to show you that. So how we can use intelligent to go in and see at run time what is happening with inner Java program? Someone jump over to intelligence and introduce you to needy bugger inside of intelligent. Now we're going to take a look at the intelligently bugger here, and the first thing I want to do is just get rid of these system out statements. So I'm just gonna delete these. I think we've seen these enough in the course so far that we don't need for their examples of this. So I'm just gonna get rid of those and we'll still keep the final one here now to using D bugger inside of intelligent, very, very simple. What we want to do is come over here to the gutter where the numbers are these airline numbers of the coat and I want to inspect what? The house square footage is at this point here. So I'm going to click there and can see I get a red circle. And now, if I come up here, actually, I can do it right here from the Ah, Nique. Same gutter. So I'm just gonna come straight up. I'm gonna right click. And now I'm going to click on the debug option. So I'm gonna go ahead and run deep bug like so and no, my reposition this. We can see the different variables that I have initialized here so you can see a number of things that intelligent is doing. If we look at Line five, we can see that the value The house square foot is 10 10. We have the living room value living room and you can see that intelligence showing the current value of how square footage, which is 10 10. And because we set this brake point here, this statement has not executed yet. So right here we can see the house square foot is going to get set up when this statement executes, it will get set to 10 10 plus 140 which is what our output will be. So if I go ahead and click on the arrow here to resume the program, I'm just gonna go ahead and say, resume, click on resume. And then now it can come back over to the council tab and take a look at the output and we can see that the house square footage got set to 11. 50. So let me let run that one more time. You can see here we have this Ah, little green icon. And that is ah, kind of supposed to be a bug so we can see it. A bug action there and again, Aiken rerun from here. Or I can come up here, say, right click debug. And also in the very top window here we can see that I have the option to run. This is the arrow to run normally and then also run in debug. So I'm just going to come down here to the bottom window, run that one more time in the d bugger and we can see that it would get right to that break point. That red line is that as I call a break point, this is where I'm telling the d bugger, I want to stop here and inspect what's happening and you can see in the intelligent window lower side. I have all the values of the different variables have as they've been set. And we can also see on the source code screen. We can see and gray the values of the variables as well. So the this is just really scratching the surface of the intelligent e bugger, but it is very valuable tool to see what is happening at runtime within your source code. So as you can see, intelligent does have very robust features for going in and seeing exactly what's happening inside of our Java code, we can see the variables, what they're currently set to. And do you remember when you are running in the debug mode and there are some system resource is are required to bring it up, bring the jbm up in debug mode so we can get this information from the jbm. But intelligent does have some additional capabilities. I want to show you how you can actually step through your code step by step, using intelligence. I'm gonna jump over to intelligent now and show you that now, intelligence D bugger does give us a number options to step through the code. So first thing that we can do is we can actually set up multiple break points. So I'm just gonna come in here and set. Ah, break point on my number five. Then I'm gonna come here, right? Click and say debug. Run that in the bugger and we can see that it stops right away at line five highlighting that Now, if I come down here and click on this little green arrow to resume the program, what's gonna happen is Intel J will advance to the next break point so automatically jump to the next break point that it finds. Now, if it didn't find a break point, it would just go ahead and not run to the termination of the program. So I'm just gonna go ahead and click on that one more time and we'll see that the program executes and exits and we can see here. If I click over the council, we can see that set up there. So I'm gonna come back up here and will run in the debug her one more time. Rand, normally right click, then hit Hit a debug. Now we can see that I'm stopped online. Five And you have several controls here you have step over or step into. Right now, our process here is pretty simplistic. So not a lot of information that could be available through step into. So if I was going into a method call into another class or something, I could actually drill into that method and debug that method here. We don't have really any method calls to work with, but the one of interest, I do want to point out is the step over. So if I click on this, we can see that it's going to advance one line at a time. And as I do that we can see. Now I'm stepping through the coat here. I've set the living room to 360 but the House square foot has not been reassigned yet. So if I click on this again, we can see now the house square foot did change to the living and value bedroom has not been initialized yet or declared. So now I'm gonna click on this one more time and we'll get over that line and we can see that bedroom One was declared an initialized A 210. But the house square foot has not been set to include that value. If I click on this one more time, we can see that that changes. And I can click on this and just scroll through each option up to the point here where I get to the system out statement. And now I can see all the different variables that ive declared and their current values. And if I click on this one more time or proceed, this will go ahead and terminate and I'm gonna run this one more time. Just toe go through this so you can see it one more time. I'm stopping at this break point on line five, and here I am going to be using the step over. So I'm just going to step over that statement and you will see that the house where foot got declared initialized. Zero living room got declared initialized at 360. How square foot gets set to 3 60 and you just keep clicking on this and step through the entire program and see how the variables air changing and getting updated real time And Aiken, take a moment to pause and inspect my logic. Make sure that everything is correct. The intelligently bugger is a very, very powerful tool and allows you to see ah, lot of what's happening within your application. 20. Java Assignment Operators: So inside the Java programming wing, which we do have a number of assignment operators and this is how we assign values to variables. Now, we've already seen the equals operator being used to assign values to variables of seen us in the last several lessons works out well, there are several more where we can combine addition, multiplication subtraction with this operator. So I'm gonna jump over and take a look at these. I got a slide prepared that you cannot download and use for your studies, and then we'll talk about what these are and the different assignment operators that we have available inside the Java programming language. So let's go ahead and take a look at the available job assignment operators. So we have the equal sign and we've already seen that used the number of times in the course, and that is just simply going to a sign of value to the variable on the left. Now we have the plus equal sign and how this is going to work. It is going to add that value to the variable on the left. So in the first example there, So if a is one and we do A plus equals five. It will become six at the end of this operation. So had Adsit in It assigns that value. So does a reassignment so very, very important that it's not only doing the addition, but it's also doing the reassignment of that value. And then we can see that we also have subtraction, same thing it is going to subtract and that this example it would subtract five from a and then a would have that final result. And then we have the multiplication operator does exactly as you would expect and then the division operator again that is going to do exactly what you expect. Then the module, its operator down at the bottom there and all these three important thing to remember is that operations going to occur and then the variable on the left is going to get assigned. The result of that operation so really does give you, ah, a little bit of shorthand to make your coating a little bit more concise, and also, some people would say, more readable here. So these air the different assignment operators that we have available for our use inside the Java programming language so let's see a Simon operators that we do have available for our use inside the Java programming language. Now, I know from the slide slide presentation, there might be a little confusing as to how to use those. I'm gonna jump over into intelligent and show you how these air used because what's happening there? It's really kind of shorthand to save us a little bit of typing. We can use these, consolidate the amount coating that we have to do where we can combine the assignment and also addition or multiplication division into one operator. And it does help us write our code a little bit more efficiently. And I'm gonna jump over to intelligent now so you can see exactly how these air are used that I think once you see them used in practice, it will make a lot more sense than what we just saw on the slide deck. Let's take a look at us some examples here of using a Simon operator. So I'm gonna come in creating a new class, and I'm just gonna call this same in operators like so Yeah, well, start off with the main class. Some just use an intelligent shortcut there and let's carry on with e Same example that we're using in our debug example. Don't do, uh, manager, and we'll call this house square foot and will say that is equal to zero. And here, let's call our living room again Now I will say, I will say, this is Ah, 15 by 20. So previously we were basically assigning it. We're doing how square foot plus living room is, how we were doing the assignments and what we can do is just get rid of this. And now weaken. Do the assignment operator like that? So now we have the plus equals, and that is going to add the living room value to the house square foot value and assign the house square foot value to that so that that is just one example. And then we can also do how square foot and then we can say minus equals 20. And that is going to subtract 20 from the house square foot and a sign that result to the variable house square foot. And we can also do the multiplication operator and with much just to five will keep it reasonable. So now we're gonna multiply that value and reassign it. And then we can also do how square foot on. Just divide that by by two. Like So I'm just going to system out. Yeah, we'll do that on let's go ahead and can captain eighth e variable end like that. Now, let's go ahead and run this. And if you notice I'm not doing a system output here and let's go ahead and run the deep bugger here, and I'm gonna put a break point right there. And now I'm gonna come up here online for right click on that and say debug and we could see that we stopped at line five. I am going to step over that line so you can see the house square foot is set to zero. Living room gets initialized a 300. Now, the house square footage is now set to 300. So we got a assigned to that value and you can see that I subtracted 20 from that. So knows to 80 multiplying by five. So goes to 1400 dividing it by two. So drops down to 700. And if I continue on here, we will get to the end of the program and just so you can see this a little bit better, let's say I started off with a house square footage of 400. That money run this in the d bugger one more time. So now we can see that we initialize it to 400. We bring in the living room, which is 300 online seven. I'm gonna go ahead and click here. We can see that that has now been added to that. So we went to 400 living room was 300 we added that end. So you can Hopefully that helps you envision how this operandi is working. So this assignment operators not only doing the arithmetic operation, but it is also re assigning it to that variable so very important to remember that it's not only doing the arithmetic, but also signing it to Nievera Bill as well