Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary - Java

Rating
-
Sold
-
Pages
46
Uploaded on
28-05-2025
Written in
2024/2025

Get an easy introduction to Java programming in this beginner-friendly guide! Our comprehensive guide will teach you all about this powerful language, even if you have never programmed before. Java is one of the most popular programming languages, and we will make sure you know why. This beginner-friendly guide is perfect for those who want to learn Java for fun or even for those who want to begin a career as a Java developer.

Show more Read less
Institution
Course

Content preview

In this course, you're gonna learn everything you need to get started
programming in Java. We'll start off by installing all the necessary tools to build
Java applications then you're gonna learn about the basics of Java you'll learn
how Java code gets executed you'll learn how to build simple algorithms and
throughout this course I'm gonna share with you lots of tips and shortcuts from
my years of experience I'll teach you how to write good code


professional developer so we'll end up watching this course you will have a solid
foundation in Java and be ready to learn about advanced Java features I've
designed this course for anyone who wants to learn Java if you're a beginner
don't worry I'll make Java super simple and hold your hands through this entire
course you're not too old or too young you'll write your first Java program in
minutes my name is mosh I'm a software engineer with two decades of
experience and I've taught over 3 million people how to code


00:00:53 and how to become professional software engineers I have a coding
school at code with mass comm where you can find plenty of courses that help
you take her coding skills to the next level I hope you'll stick around and learn
this beautiful and powerful programming language and now award from this
video sponsor as someone who runs an online business I cannot stress enough
the importance of staying safe online which is why I was so excited when
dashlane reached out to me if you don't know - Lane is the password manager
and VPN recommended by


00:01:23 Apple and Google and it's a fantastic safeguard for keeping your
information secure it's completely free to use for your first device so head over
to - Ling comm / marché - give it a go if you want to upgrade to the premium to
get VPN or dark web monitoring you can use the promo code mosh to get 10%
off sign up for - 9 today and keep yourself safe online now back to the course in
this java tutorial we're going to download and install the necessary tools to build
java applications so open up your browser and search for jdk download


00:02:01 jdk is short for Java development kit and it's basically a software
development environment for building Java applications it has a compiler it has a
bunch of code that we can reuse it has a Java Runtime environment at a bunch of
other stuff so over here you can see this page on Oracle com Java se which is
short for Java standard edition click on this now over here click on this icon now
on this page we can see Java development kit for various platforms like Linux
Mac OS and Windows here I'm on a Mac so I'm gonna download


00:02:38 this dmg file over here now before we do this first we need to
accept the license agreement all right now let's download the dmg let me open
this we're gonna say this package let's double click this and here we see this
installation wizard it's super easy just click continue and install you have to enter

,your computer's password and then alright done beautiful so we can move this
to trash now the next piece of software we need is a code editor there are so
many cool editors for building Java applications the popular ones are


00:03:15 NetBeans Eclipse and IntelliJ in this Java course I'm gonna use
IntelliJ but if you have a favorite editor feel free to use that to take this course
that's perfectly fine so let's search for IntelliJ download all right you can see
download IntelliJ IDEA click on this link over here download the community
edition which is absolutely free and it's more than enough for this course so
download all right now let's drag and drop this onto the Applications folder
beautiful alright we've installed all the necessary tools to build Java


00:03:53 applications so next we're gonna look at the anatomy of a Java
program in this java tutorial we're gonna look at the anatomy of java programs
the smallest building block in java programs are functions if function is a block of
code that performs a task as a metaphor think of the buttons on the remote
control of your TV each button performs a task functions in programming
languages are exactly the same for example we can have a function for sending
emails to people we can have a function for converting


00:04:28 someone's weight in pounds to kilograms we can have a function
for validating users input and so on now let's see how we can code a function in
Java we start by specifying the return type of that function some functions return
a value like a number at day time and so on other functions don't return anything
so the return type of this functions is void void is a reserved keyword in Java and
that's why I've coded that in blue here now after the return type we have the
name of our function so here we should give our function a proper


00:04:59 descriptive name like send email this name clearly identifies the
purpose of this function okay now after the name we have a pair of parentheses
and inside these parentheses we add the parameters for this function we use
these parameters to pass values to our function for example our send email
function should have parameters like who is the receiver what is the subject of
this email what is the content of this email and so on now in this tutorial we're
not gonna worry about parameters we'll look at them in the future


00:05:29 now after the parentheses we had a pair of curly braces and inside
these braces we write the actual Java code now one thing I want you to pay
attention to here is that in Java we put the left brace on the same line where we
define our function in other programming languages like C sharp it's more
conventional to put the left brace on a new line but we don't do that in Java so
we put the left brace on the same line where we define our function now every
Java program should have at least one function and that function is called

,00:06:02 main so main is the entry point to our programs whenever we
execute a Java program the main function gets called and the code inside this
function gets executed okay now these functions don't exist on their own they
should always belong to a class so a class is a container for one or more related
functions basically we use these classes to organize our code just like how
products are organized in a supermarket in a supermarket we have various
sections like vegetables fruits cleaning products and so on each section


00:06:36 contains related products by the same token a class in java contains
related functions now every Java program should have at least one class that
contains the main function can you guess the name of that class its main so this
is how we define a class in Java we start with a class keyword then we give our
class a proper descriptive name and then we add a pair of curly braces now the
functions that we define in between these curly braces belong to this class and
more accurately we refer to them as methods so a method is a function that is
part


00:07:12 of a class in some programming languages like Python we can have
a function that exists outside of a class so we call it a function but when a
function belongs to a class we refer to it as a method of that class okay now in
Java all these classes and methods should have an access modifier an access
modifier is a special keyword that determines if other classes and methods in this
program can access these classes and methods we have various access
modifiers like public private and so on now most of the time we use the public
access modifier so we


00:07:48 put that in front of our class and Method declarations so this is the
basic structure of a Java program at a minimum we have a main class and inside
this main class we have the main method now you might be curious why we
have a capital m in the name of this class because in Java we use different
conventions for naming our classes and our methods to name our classes we use
the Pascal naming convention and that basically means the first letter of every
word should be uppercase in contrast to name our methods we use the


00:08:21 camel naming convention and that means the first letter of every
word should be operate case except the first wart so that is why we have a
capital m in the name of this class alright now that you understand the anatomy
of a Java program let's create a new Java project and see all these building blocks
in action in this Java tutorial you're gonna learn how to write and execute your
first Java program so let's open IntelliJ IDEA here on the home screen let's create
a new project alright on the left side select


00:08:59 java and make sure project sdk is not black so earlier we
downloaded jdk or Java development kit version 12 that is why JDK version 12 is

, selected here if you don't see that make sure to select it from this drop-down list
alright now let's click on next on this page select create project from template so
we're gonna create a command line application which is an application that we
can run from the command line it doesn't have a graphical user interface or a
GUI now I know command line application is not as exciting as an application
with a


00:09:33 graphical user interface like a mobile app or a desktop app but trust
me building an application with a graphical user interface is very complicated so
for now we're just gonna build command line applications to learn Java properly
once you learn Java properly then you can learn about building desktop or mobile
applications with Java all right now let's click on next on this page we have to
give our project a name let's call it hello world now over here you can see the
location of this project so it's inside the idea projects folder now


00:10:07 right below that you can see the base package which is set to comm
that code with Marsh on my machine and your mission is probably gonna be
comm dot package what is this well here we talked about classes and methods I
told you that a class is a container for related methods so we use classes to
organize our code by the same token we have a concept called package and we
use a package to group related classes so as our applications grow we're gonna
end up with hundreds or even thousands of classes so we should properly
organize


00:10:39 this class us into packages now by convention the base package for
a Java project is the domain name of your company in Reverse so my website is
code with mass comm that is why I'm gonna set the base package for this
project to come that code with Marsh now it doesn't mean that you should have
an actual domain registered on an Internet this is just a way to create a
namespace for our classes so now every class that we create in this project will
belong to this package we're gonna talk about packages in more detail in the
future so for now just type a base package for


00:11:12 your project it can become that your name or whatever it doesn't
really matter all right now let's go forward alright here's our first Java project now
this code editor might look a little bit intimidating at first but trust me it's really
easy and you're gonna learn about it throughout this course on the left side we
have the project panel where we can see all the folders and files in a project for
example on the top we have the hello word project inside this project we have
the source folder where we have the source code of


00:11:44 a project now in this folder we have another folder that is calm that
code with Marsh that is the name of our base package and in this package we
have this class main so you can see this main file opened on the right side here

Written for

Course

Document information

Uploaded on
May 28, 2025
Number of pages
46
Written in
2024/2025
Type
SUMMARY

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
elvisjamesg

Get to know the seller

Seller avatar
elvisjamesg Patrician college of arts and science
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
11 months
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions