Full Stack Java developer - Java + JSP + Restful WS + Spring
- Description
- Curriculum
- FAQ
- Reviews
Welcome to our Full Stack Java Developer course designed for learning enthusiasts who want to create a quick and efficient web application.
If you have some Java knowledge and little or no knowledge about Java programming, this course is perfect for you. In this course, you will be able to combine all the ways to connect to the database and learn how to make it informative and attractive.
The course is divided into several sections, starting with Java, including multi-threading, Lambdas, Collections debugging, and an introduction to GIT.
After mastering Java, we will move towards JSP and Servlets, followed by exploring Hibernate. Once we have covered core technologies, we will move towards the Spring framework, one of the most popular Java frameworks. We will cover Spring framework, Restful web services, and finally, Spring Boot.
Course Content
-
Java Fundamentals
-
Introduction to Java core concepts
-
Multi-threading
-
Lambda expression
-
Collections framework, Java Generics,
-
File handling and debugging
-
Introduction to GIT
-
-
JSP and Servlets
-
Create-Deploy Servlets & Understand Servlet Lifecycle
-
Forms under JSP and Servlets
-
Develop Dynamic Web Applications
-
JSTL core tags
-
Learn MVC in JSP
-
Image/File upload
-
-
Hibernate
-
Introduction to Hibernate
-
Building an application using JSP and Hibernate
-
-
Spring Framework
-
Introduction to Spring Framework
-
Request param and Model under Spring MVC
-
Database Connectivity using JDBC
-
-
Restful web services
-
Resource-based URIs for CRUD methods
-
JSON response
-
HATEOAS – get links from resources
-
Idempotence of HTTP Methods
-
JAX-RS and implementations
-
-
Spring Boot
-
Webapp with Spring boot
-
Setting up a Restful web app
-
Building restful microservice with Spring boot
-
Perform CRUD operations
-
Create Eureka server
-
Eureka client
-
-
JUnit
-
Introduction to JUnit
-
Junit test method
-
Testing exceptions
-
Course Features
-
Learn Java Server Pages from basics to advance.
-
Understand building web forms with JSP and Servlets.
-
Learn object-oriented programming concepts, flow control, method parameter and return type, core concepts, arrays, collections, debugging, generics, multi-threading, Lambdas, and file handling under Java.
-
Introduction to GIT.
-
Create and deploy Servlets, understand Servlet Lifecycle, and JSTL core tags.
-
Learn MVC in JSP, image/file upload, and web application development with Spring Boot.
-
Add post functionality, develop Restful microservices with database connectivity, and perform CRUD operations.
-
A wide range of concepts applied to projects to implement your new skills.
Why Choose This Course?
-
Comprehensive course content covering all the basic concepts, tools, functions, and required topics a Java Developer requires during the web application development process.
-
Unique and easy-to-understand teaching style.
-
A hands-on approach that allows you to practice what you are learning.
-
Learn a powerful skill in the comfort of your home.
-
Develop the ability to create functional, useful Java programs, and enable users to log in and manage sessions.
-
Improve your career prospects as an IT professional.
Why Learn Full Stack Java Development?
In today’s digital era, where web applications are at the heart of businesses across various industries, acquiring in-demand skills is crucial for IT professionals. One such sought-after skillset is that of a Full Stack Java Developer. With its ability to facilitate the development of dynamic and static web content, and empowers developers to create robust and engaging web applications. Learning Full Stack Java Development can enhance your career prospects and enable you to excel in the ever-evolving field of IT.
Mastering Full Stack Java Development offers numerous advantages for IT professionals looking to enhance their careers. With its comprehensive skillset, high demand, end-to-end project involvement, flexibility, and collaborative nature, Full Stack Java Development opens doors to exciting opportunities in web application development. By investing in learning this versatile technology, you position yourself as a well-rounded professional capable of driving innovation and delivering exceptional solutions in today’s fast-paced digital landscape.
So, take the leap and embark on the journey to become a Full Stack Java Developer today!
About the Instructor
The course instructor brings teaching experience and industry knowledge to the course. He has taught IT for more than 8 years to more than 1,40,000+ students, and he is also a web application developer. His teaching style is unique and easy to understand.
No question asked – Money Back Guarantee!
There is no risk, this course comes with a 30-day money-back guarantee. Once you purchase the course, if for any reason you are not satisfied with the course, please let me know, and I will refund 100%, no questions asked. So you’ve got nothing to lose, check-in for this course, and learn “Full Stack Java Developer”
So, what are you waiting for?
Enroll in this course today and start your journey toward becoming a Full Stack Java Developer. With our easy-to-follow course and personalized support, you will be amazed at how quickly you can learn and master this technology. Practice every day and become an expert in Java programming. Remember, practice makes perfect, and it all depends on your efforts and hard work.
Enroll now and take the first step towards becoming a Full Stack Java Developer expert!
Join me on this adventure today! See you on the course.
-
1About the courseVideo lesson
-
2Background StoryVideo lesson
History of Java
In 1990, Sun Microsystems launched a project called Green to develop software for consumer electronic products. Gosling began to write software in C ++ to embed elements such as toast, VCR, and personal digital assistants (PDA). The history of java started with Green Team. In this team, there were three members James Gosling, Mike Sheridan, and Patrick Naughton protecting the language started in June of 1991.
It was named “Greentalk” by James Gosling. The file extension was ".gt". Later it was called Oak. Oak is a national tree of many countries like the U.S.A, France, Germany, Romania, etc. In May 1995, Oak was renamed as “Java” given by James Gosling, by then it was already a trademark of the organization.
There were more choices of names before finalizing, but Java was so unique, so James and most of his team members preferred Java.
A more interesting fact is related to Java, Java is an island in Indonesia where the first coffee was produced and the name of the coffee was Java. Java is a name, not an acronym.Java coffee consumed in large quantities by the creator of the language. This indicates the story behind the logo of Java.
#History #Java #Programming #Language #JamesGosling #Inventor
-
3Review and ratingVideo lesson
-
4Meet your AuthorVideo lesson
-
5Linkedin and Instagram linksText lesson
-
6Download linksText lesson
-
7Download process and installation of Java (Windows)Video lesson
The lecture deals with the download and installation of JDK(Java Development Kit) from the official Oracle Site.
-
8Download and installation process of EclipseVideo lesson
In this tutorial, download, and installation of the Eclipse framework are shown by making use of the installation of the package(Eclipse IDE for Java EE Developer).
-
9A short messageVideo lesson
-
10The language of 50 keywordsVideo lesson
Keyword
This tutorial deals with the concept of keywords in Java. Keywords are special entities that are predefined in Java. These words cannot be used as identifiers. Out of the 50 keywords, 48 are currently in use (const and goto not in use).
A Java keyword is one of the 50 reserved keywords for a programming language. Each keyword has a specific meaning in the language. These keywords are already known by Java.
Rules to follow for keywords:
Keywords cannot be used as identifiers for class, subclass, variable, and methods.
Keywords are case-sensitive.
Here is a list of keywords in the Java programming language:
abstract
assert
boolean
break
byte
case
catch
char
class
const*
continue
default
do
double
else
enum
extends
final
finally
float
for
goto*
if
implements
import
instanceof
int
interface
long
native
new
package
private
protected
public
return
short
static
strictfp
super
switch
synchronized
this
throw
throws
transient
try
void
volatile
while
*****************************************************************
Some significant points about Java keywords:
true, false, null might seem keywords but aren't
All keywords are in lower-case.
More on this topic ahead of the tutorial.
#keywords #reserved words #case-sensitive #java #rules
-
11Our first Java programVideo lesson
In a programming language, it is essential that one must start with the basics to understand the concept. The most common program which helps to understand programming concepts is the Hello World program. Also, our first program in general. This lecture contains the configuration of the eclipse environment to set up for our first Java program to print 'Hello World!'.
A java program structure includes:
comments section: comments are used to add further detailing to our program. It is ignored by the compiler during execution.
import statement: In Java, the import statement is used to bring certain classes, interfaces, or entire packages to a program. A class can be referred to directly by using only its name.
public static void main(String args[]): The main method of a Java program
System.out.println(): to print output on the console.
#first_program #Java #Hello_World #console #print_statement
-
12Variable and datatypeVideo lesson
Variable
Variable is a chunk of memory that can store information. Each piece of information (variable) has a data type associated with it. The data type has an effect on the operations that we can perform on the specific variable. Variables of certain data types can deal with variables of the same type unless they are manipulated (typecasting).
In other words, the variable indicates the value that can change according to the variable type.
Like characteristics, number, and quantity can increase or decrease or takes different values in a different variable.
Datatype
A data type defines the size and type of information stored in a variable. Data types help in memory management. Depend upon the type of data type memory is assigned to a variable.
Java has numerous data types and all data types are predefined, which is used to store a large amount of information.
There are two main categories of data type primitive and non-primitive which classified the various data type. The following primitive data types and non-primitive data types classified as follows.
Primitive type includes:
Integer type: It is further divided into subcategories of datatypes.
byte
short
int
long
Floating type: Another datatype further divided into subcategories.
float
double
Non-Primitive types include:
String
Array
Such details will be studied further in this course.
-
13Understanding variablesVideo lesson
Understanding Variables
The manipulation of two variables having the same datatype is shown. The variables can be modified with help of any constant or otherwise with the help of the same datatype. Issues such as case sensitivity and order of execution of statements are shown here.
The variable can be declared to store data in the program. There are few variations in how we can declare a variable in a programming language. The following program will demonstrate how we can declare and then initialize an int variable.
Multiple variable initializations within a statement
When it comes to multiple variable initializations, Java also supports multiple initializations within a single statement within the statement. We can also merge the declaration and initialization of multiple variables within a single. To initialize multiple variables, we need to use a comma-separated list.
Initialization of variable through arithmetic operation
After the arithmetic operation, the final result would be assigned to the variable. Assignment of the result is done using the assignment operator (=) and the assignment sequence is from right to left. If you make use of the bracket within the operation, operation inside the bracket would be performed first.
Assigning one primitive variable to another
We can also assign a value to a variable by using another variable. This is also called copying the value of one variable into another.
Demonstration
Assign any integer value to an int variable.
Assign the variable value to a variable.
Naming Convention
The names of variables are case sensitive “value” and “Value” both are different.
Space is not permitted in variable names
-
14Primitive Data Types (Integer datatype)Video lesson
Primitive Data Types
This tutorial describes the integer datatype and the similar types of the datatype with a couple of differences. Various operations like the maximum and minimum are shown. The following primitive datatypes are discussed are as follows.
1.byte(memory->(1 byte,8 bit),range->(-128,127))
2.int (memory->(4 bytes,32 bits),range->(-2^31,2^31))
3.short(memory->(2 bytes,16 bits),range->(-2^15,2^15))
4.long(memory->(8 bytes,64 bits),range->(-2^63,2^63))
Java supports eight primitive data types. These are the basic and predefined datatype of programming language. The size of the primitive data type is fixed. Primitive data types are represented by reserved keywords.
The primitive data type is divided into following categorize
Integer data type.
Floating Point data type.
Boolean data type.
Char data type.
Integer data type
An integer data type is used to store integer numbers (numbers without a decimal point). The minimum and maximum value that a variable can store also depends on the data type.
The range of Integer data types
We have a list of integer datatype, As the memory allocation of these different flavors of integer datatype is different, the range of these data type also differs. Based on our requirement, we can choose any flavor of integer datatype, int datatype being the most popular and recommended, as int performs fastest among all the flavors.
byte
The size of the byte type is 8bit/1byte. The minimum value of the byte variable is -128 and the maximum being 127.
short
The short data type is an integer-compatible data type and used to contain an integer value. The size of the short type is 16bit/2byte.
int
The size of the int value is 32bit/4byte. The minimum value of int is -2,147,483,648 and the maximum range is 2,147,483,647.
long
The size of the long data type is 64bit/8byte. While declaring long data type we have to use the suffix “L” by default java considered it as an int. It is recommended that you use the uppercase letter “L” because these are case-sensitive.
Initialization of long variable:
long longMax = 9,223,372,036,854,775,807L;
long longMin = -9,223,372,036,854,775,808L;
[ L specifies that value is a long. ]
-
15Primitive Data Types (floating point datatype)Video lesson
Floating Point data type
The tutorial describes the float and the double primitive datatypes. Mostly used while dealing with decimals. The float datatype occupies 4 bytes hence will have a range from -2^31 to 2^31. It has single-precision(7 decimals)hence it is not used for complex calculation. For that purpose, double is used. The double occupies 8 bytes and hence double precision(15 decimals). This also outlines the various techniques of implementing the above datatypes.
Floating-point variables are used to deal with the decimal value. There are two types of floating-point data types. float-point types with storage sizes and range with their precision.
In the program, whenever we want to store a floating-point value in a variable, we can use one of these data types accordingly.
Initialization of float variable:
float var = 9f;
[ f specifies that value is a float. ]
Precision in float (7 spaces)
*********************************
double: double is used to store value with precision up to 16 spaces, it occupies 64-bit memory
Initialization of double variable:
double var = 9d;
[ d specifies that value is double. ]
Precision in double data type is more than a float data type.
-
16Primitive Data Types (boolean and char)Video lesson
This deals with the boolean datatype. The boolean data type has only two possible values: true and false. This data type is used for simple flags that track true/false conditions. This data type represents one bit of information, but its memory constant isn't precisely defined. Char datatype is a 16-bit Unicode character. It has a lower limit of 'u0000' (0) and a highest value of 'uffff' (or 65,535) both inclusive.
Boolean
Boolean is a data type that represents one bit of information either true or false.
Char
A char data type is a single-length entity. This could be an alphabet, a digit, or a symbol. It is also used to hold the Unicode for symbols. Value for char should be with single quotes.
Note: We must only use the single quotes pointing to left
The length should be one.
Single quote point to the left should be used
Any character on the keyboard is allowed
Example: ‘A’,’*’,’1’
More details about these concepts can be understood in this lecture.
-
17BigDecimal class introductionVideo lesson
BigDecimal Class
To calculate complex arithmetic operations, Java uses primitive datatypes like float and double. But there is a problem with these primitive datatypes. The floating-point datatypes are not considered to be accurate while calculating precise values. So you cannot use them in a financial calculation. As a result, these operations could perceive surprising and unexpected results. To overcome this scenario Java introduced BigDecimal class.
A BigDecimal class can handle small as well as large floating-point number with great precision.
This class approximately fits into the same category as the “wrapper” classes but has some very useful methods.
This class has methods that provide analogs for the operations that you perform on primitive types. That is, you can do anything with a BigDecimal that you can with an int or float, it’s just that you must use method calls instead of operators. Also, since there’s more involved, the operations will be slower. You’re exchanging speed for accuracy.
BigDecimal is for arbitrary-precision fixed-point numbers; you can use these for accurate monetary calculations. Below Java code explains the concept of accuracy in calculation. One part is doing all calculations using double while another part is having calculations using BigDecimal. The output shows a difference between them.
-
18String basicsVideo lesson
This session deals with the Strings. Strings represent character strings. The various rules associated with string are stated in addition to some operations. Also, an introduction to typecasting is given (which is a conversion between the datatypes).
String
A Sequence of characters inside double quotes is called String, for e.g., “Java” String is the sequence of 4 characters.
Initialization of String variable
In the below example, we will create a String. Here var is the reference of data “Hello World” of type String.
String var = "Hello World";
Unicode symbols can also be stored as String. Unicode is a universal international standard character encoding that represents most of the languages in the world.
String var1 = "u00BB";
Discussions on the same are continued in upcoming lectures.
-
19Type castingVideo lesson
This lecture deals with typecasting from basics to advanced. The conversion from one datatype to another is described here. This tutorial covers both types of typecasting namely explicit and implicit typecasting. Implicit typecasting is automatically done by the compiler to convert datatypes with large memory space to short memory space. The other (Explicit typecasting)has to be manually declared. It covers all the rules for conversion for typecasting.
In Java, Type Casting is a process of converting a variable of one data type into another.
Typecasting is of two types:
Implicit typecasting.
Explicit typecasting.
Implicit typecasting
Implicit type casting is also known as Widening or Automatic typecasting. When a small range data type variable is converted into a large range data type, The process is called implicit typecasting.
Explicit typecasting
Explicit typecasting is also known as narrowing typecasting. When a large range data type is converted into small range data.
Do you know?
Data type should be compatible for conversion. A non-primitive data type cannot be converted into a primitive type.
The precision loss may happen in Explicit typecasting.
-
20EXERCISE - Solve an equationVideo lesson
In this program, we will be performing a simple equation in which we will calculate the result.
So which datatype would be best suitable for an algebraic expression?
Let us see, in our program, we are making use of two different datatypes: int a and float b.
As per Java convention, it is said higher the order of a datatype, the highest preference is given to that datatype.
The value of the result is stored using double datatype. So by default, Java will assume the result to be calculated in double type.
But there is a twist in our program, as we have provided the value of b which is a float type, ending with literal 'f', now our program output will provide a precision equivalent to 7-decimal.
Another scenario where we want our result must be calculated in int type, so how we will do that?
We have to make use of the explicit typecast concept to fulfill our requirements.
In this video tutorial, the steps are mentioned and the instructor had given a complete explanation of how to do it.
-
21When to use what?Video lesson
-
22Articles and BlogVideo lesson
-
23Quiz on section 3Quiz
Quiz Consists:
Multiple Choice question
True or false Type Question
Practice Program: identify Output.
Please go through all lecture video and resources before attempting the Quiz
-
24FAQ for the courseText lesson
FAQs by students in this course are provided in the following document.
-
25Project filesText lesson
These are all the source codes of the programs discussed so far in the section. At the end of each section, we have presented the same.
-
26Videos from this sectionVideo lesson
-
27Understand Udemy interface and how to get completion certificateVideo lesson
-
28Project files and downloadable material and articlesVideo lesson
-
29How to Import Project Files?Text lesson
-
30Videos for Java and IDE installation on MAC and LinuxText lesson
-
31IntelliJ Installation and hello world program in IntelliJVideo lesson
-
32Import eclipse project on IntelliJVideo lesson
-
33Connect on LinkedIn, "It's good!"Video lesson
-
34Arithmetic operatorsVideo lesson
This lecture deals with basic operators in java as the addition, subtraction, multiplication, and division operators. (+,-,*,/). In addition to these Operators, it also contains information about the increment(++) operator which increases the value by 1 as contrast to the decrement operator(--) which does exactly the opposite. Modulo operator(%) gives the remainder of two numbers.
Java provides a rich set of operators to manipulate a variable. Operators are the symbols in Java that perform a specific operation on many operands and return the output. Before knowing the arithmetic operators, let us know the type of operator.
Java operators are divided into the following groups:
Arithmetic Operators
Assignment Operators
Bitwise Operators
Logical Operators
Relational Operators
Operators
Arithmetic operator
In this tutorial, we will discuss the arithmetic operator. Mathematical operations are done by using arithmetic operators. The following table displays all the arithmetic operators supported by java. Assume integer variable “A” holds value 5 and variable “B” holds value 10.
Addition Operator
Plus (+) operator is used for the addition of two numbers. In addition to adding two numbers, the addition operator is also used for string concatenation.
Subtraction operator
Minus (-) operator is used for subtracting the second operand from the first.
Multiplication Operator
Multiplication (*) operator used to multiply two numbers.
Division Operator
Division operator (/) used to divide numerator by de-numerator and it gives the quotient.
In the following illustration 12 divided by 2 and the result is 6.
Modulus operator
Modulus operator used to returns the remainder of one number divided by another.
Increment operator
Increment operator is a unary operator that increments its operand by one. This operator can be used for both postfix(x++) as well as a prefix (++x).
Postfix-In the postfix form, it evaluates the value of the operand before the increment operation.
Prefix-In the prefix form it evaluates the value of the operand after the increment operation.
So do you now understood the difference?
In prefix, the value of the variable will get incremented first and then the statement will get executed. Whereas in postfix, the statement will be executed with the current value of the variable and then the value gets incremented
Decrement operator:
Decrement operator is also a unary operator that decrements its operand by one. This operator can be used for both postfix(x--) as well as a prefix (--x).
Postfix-In the postfix form, it evaluates the value of the operand before the decrement operation.
After this tutorial, you will be able to use these operators efficiently in your program.
-
35Making decision with operators - Part 1Video lesson
In this video tutorial, we will take one simple example to define operations using the decision-making concept. All the basic arithmetic operations programs will be provided with an explanation in each of the parts.
This tutorial deals with the 'if' condition. The if condition verifies the basic yes or no condition. If this given condition is satisfied the statements inside the if cases are executed. Or if false the 'else' case is executed(if written or defined). The scope of the if statement and the implementation of this will be discussed further.
-
36Making decision with operators - Part 2Video lesson
In this video tutorial, we will take one simple example to define operations using the decision-making concept. All the basic arithmetic operations programs will be provided with an explanation in each of the parts.
This tutorial is the continuation of the lecture above. In the lecture the implementation of if condition is shown.
-
37Making decision with operators - Part 3Video lesson
This lecture deals with more cases that could be used in if-else condition. The use of &&(and) operator and ||(or) operator for condition checking is used along with !(not) or negation operator. At the end of the lecture, we will be able to use these in our programs efficiently.
-
38Ternary operatorVideo lesson
This tutorial deals with three operands we use the ternary operator. It can be used as a single-line substitution for the given if-else condition. We can also use it to replace the switch. The basic syntax of the ternary operator along with the rules is shown in the following. At the end of the lecture, we will be able to use these in our programs efficiently.
Ternary Operator In Java
The ternary operator works on three operands. It returns a value based on a condition that evaluates either true or false statements. True and false statements are also an expression that you want to evaluate. If the expression is true it evaluates the expression true otherwise it evaluates the expression false.
The ternary operator is also known as a conditional operator that evaluates a condition of if-then-else. In Java “If” statement is used to make a decision based on a condition that allows testing a condition if the condition is true, the code inside “if block” will be executed, and else statement will execute when a condition is false.
Ternary operator has three operands: Condition? Expression 1: Expression 2
The condition is evaluated.
If the condition is true then Expression1 is returned.
If the condition is false then Expression2 will be returned
The ternary operator allows you to evaluate a Boolean expression that evaluates the true or false expression. If the condition is true then it will evaluate expression true otherwise it evaluates the expression false.
The ternary operator allows to returning of an output based on the relational operator.
Note: If two primitive values are equal you must use the comparison operator “==” not “=”.
-
39Assignment operatorsVideo lesson
Assignment Operators
Assignment operators are a binary operator that is used to assign a value of an expression to a variable on the left-hand side of the operator, with the result of the value on the right-hand side of the equation.
In Java, the assignment operator are as follows: =,+=,-+,*=,/=,%=
The simplest assignment operator is “=” assignment (int x= 1 ;)
Compound assignment operator in java
Besides the simple assignment operator”=” there are also various compound assignment operator. For example, the following statement after the declaration of x is equivalent:
x += 5; // simple assignment operator
x = x+5; // compound assignment operator
x -= 5; // simple assignment operator
x = x-5; // compound assignment operator
x*= 5;// simple assignment operator
x = x*5; // compound assignment operator
x /= 5; // simple assignment operator
x / 5; // compound assignment operator
x %= 5; // simple assignment operator
x = x%5;// compound assignment operator
This tutorial deals with assignment operators in java which provides an easier syntax for assigning a result of arithmetic or bitwise operator. The basic syntax along with the use of 4 assignment operators which are ([+=, -=, *=, /=, %=]) is shown in the program.
-
40Making decision with if elseVideo lesson
Making a decision with IF-Else
In this tutorial, we deal with the advanced details of the if-else condition.
IF Statement
If statement is one of the control flow statement. In Java If statement is used make decision based on condition.
In If statement we test a condition, if the condition is true, the code inside “If block” will be executed and if the condition is false, the code inside if the condition is ignored. Braces “{ }” decides the scope of if statement.
IF-Else Statement
An if statement can be followed by an optional else statement, which executes when the Boolean expression is false.
“If” block would be executed when the condition is true (if x is equal to 5), otherwise “else” block is executed when the condition is false (value of x is greater than 5. Which will execute the ‘else’ block).
The tutorial highlights the errors committed while using if condition also gives insight into the scope of the if, else, and if-else statements. The nested-if condition also described here with various cases and code blocks. At the end of the tutorial, we have a better understanding of if conditions.
-
41Discussion forumVideo lesson
-
42ExerciseQuiz
-
43Project filesText lesson
These are all the source codes of the programs discussed so far in the section. At the end of each section, we have presented the same.
-
44Quiz on section 5Quiz
Quiz Consists:
Multiple Choice question
True or false Type Question
Practice Program: identify Output.
Please go through all lecture videos and resources before attempting the Quiz
-
45Switch case - Part 1Video lesson
The switch case is a more advanced version of else and if-else conditions. The switch case is a multi-way branch statement. We can assign n number of conditions for n cases in short as a contrast to the else and if-else. It also doesn't require code blocks. There are various further uses and details which will be seen further.
Switch Case
Switch case statement in java is the conditional statement that executes one statement out of many statements when the condition is matched. Default statement is executed when none of the conditions is matched.
Switch case always works on condition, switch case is always used with a break statement.
Do you Know?
It is not necessary to write case statements in sequence.
Only int, char, String, and Enum are allowed as switch expression.
-
46Switch case - Part 2Video lesson
This tutorial contains more in-depth information about the switch. The switch condition can only make use of int, char, and enum datatype. (enum is to be seen further- It is a user-defined datatype). The switch conditions have a variety of features as such multiple conditions for the same output. The implementation of the char datatype in the switch case is also shown here.
String as an expression
A String can be used as an expression in a switch statement. This switch statement expression is compared with the expression of each case. This comparison is case sensitive, so we convert all expressions into lower cases.
The following program explanation is provided in the video tutorial.
-
47Switch case - Part 3Video lesson
In this topic, we will make use of string as an expression methodology and try to execute the program using the switch case approach.
This tutorial about the switch case contains information about implementing the switch with String datatype. Also working with functions with String to manipulate the outcome of the program and apply various conditions for the same output is shown.
Program explanation is provided in the tutorial.
-
48For loopVideo lesson
This tutorial deals with the implementation of for loop. The for loop deals with executing the code continuously over a given range of values specified by the user.
In a programming language, a loop means repeating the execution to the instruction or instruction block with respect to the condition specified by the programmer.
Types of loops in Java
while loop
for loop
do-while loop
For loop
In Java for loop is used to iterate a part of the statement multiple times until a particular condition is satisfied.
Syntax
for(initialization; condition; increment/decrement)
In the basic structure of for loop, there exist three parts
Initialization of variable
Condition
Variable increment /decrement
Initialization of variable
It initializes the variable which starts the loop. It does not matter how many iterations are present. It executed only once at the beginning of the “for” loop.
Condition
It is used for testing the exit condition and returns the Boolean value true or false if the condition is true the body is executed else the loop terminates without executing the statement loop body.
The condition in the loop doesn’t have any restriction; we can use any condition and any number of comparisons.
Variable increment and decrement
The increase and decrease part of for loop is used for updating the variable for the next iteration.
Note: All of the above is an optional component for a loop.
The further detailed implementation is shown in the next lecture along with implementation for prime numbers.
-
49About Project filesVideo lesson
-
50While loopVideo lesson
This tutorial deals with the implementation of a while loop in java. The while loop in java is same as a for loop and used to execute a statement repeatedly until it satisfies the given Boolean condition. It also deals with the condition of an infinite loop which can arise in the while loop.
while loop
while loop in Java is a structure that executes a statement of code multiple times until the boolean expression is false.
In while loop, boolean expression is evaluated before the execution of code. If the boolean expression is evaluated as true, then only the execution of code starts, and if the expression is evaluated as false, the block of code inside while loop will not be executed.
Infinite loop
The boolean expression, that is evaluated before each loop iteration is never modified, so the expression (true) will always evaluate true. The result is, the loop will never end. It is known as an infinite loop.
Difference between for loop and while loop
For loop is used when we know the number of iterations. For example when we are sure that how many times we need to execute a loop.
While loop is used when we are unsure about the number of iteration and want to loop while some condition is true. It will loop that block until the condition is false.
-
51Do while loopVideo lesson
This tutorial deals with the do-while condition in Java programming. In this tutorial, the basic difference in the do-while, while, and for the loop is shown. The do-while loop is a variant of while loop which will execute for at least one time even if the condition is false. Hence this program will explain the concepts of the do-while loop in java.
do...while loop
Java allows you to create a do-while loop, which likes almost similar to a while loop, which is a structure of the repetition control with a termination condition and statements, or block of statement.
Difference between while and do-while loop
In Java While loop, the expression is evaluated at the beginning of the loop and if the expression is evaluated as True then only statements inside the while loop will be executed. So, while loop executes the code block only when the expression is true.
In Java Do While loop, the expression is evaluated at the end of the loop so even if the expression returns false, statements inside the code block will be executed at least once. Observe the semi-colon at the end of while condition’s parenthesis
Note:
Use while loop when a loop might not be executed at all.
Use a do-while loop when the loop is executed at least once.
-
52Loops RevisitedVideo lesson
This tutorial deals with the multi-variable implementation of for loop and the while loop. The implementation of these loops regarding a single boolean condition was discussed earlier. After the completion of this section, users will get a complete reference about various types of loops and their variants along with their implementation.
-
53Break and continueVideo lesson
Break and continue statement
In this tutorial, we will discuss the Break and Continue statement.
Break statement
Sometimes it is required to do terminate the loop, without verifying test expression. In such cases break statement can be used. The break statement normally used with the conditional switch statement and do, while, or for loop statement. The break statement transfers the flow of control out of the current scope.
Continue statements
Sometimes if the programmer wants to skip a few statements inside the loop. In such cases, continue statements are used. Generally, the continue statement ends the current iteration of the loop.
-
54Nested loopsVideo lesson
This tutorial deals with an advanced variant of for loop. The use of nested loops arises when we need an iteration over repeated conditions. For example, any operation on a matrix such as a matrix multiplication would require the user to iterate through rows and columns separately. The tutorial also implements the program of pattern printing which is the basic question in competitive programming.
Nested Loop
A nested loop is a loop within a loop, an inner loop within the body of an outer one. In this tutorial, we will learn the syntax for nested loops and understand the examples.
Nesting of loop is used for maintaining a structure where more than one loop can be performed. But using this type of looping structure, sometimes it becomes complex to understand the logic. Everyone who has started learning Java must practice the Nesting of loops in general.
It clarifies the concept of Java and makes a clear understanding of the concept. The inner loop and outer loop concept distinguish the structure of the loop significantly.
-
55Nested loops - exerciseVideo lesson
This tutorial is a continuation of the previous lecture which deals with the nested loops. In this tutorial, students are expected to print the required pattern which requires them to have a basic knowledge of nested loops.
-
56Quiz on section 6Quiz
Quiz Consists:
Multiple Choice questions.
True or false type questions.
Practice program: Identify output.
-
57Modulo operator (Bonus)Video lesson
The following tutorial deals with Modulas operator often known as a modulo operator. The following video is a bonus lecture that is made to understand the concepts of this special operator with the help of a practice problem.
-
58Sum Of digit solution (Bonus)Video lesson
Another bonus video lecture made to understand the program sum of digits using decision controls and looping concept.
-
59We have started AI related coursesVideo lesson
-
60Project filesText lesson
These are all the source codes of the programs discussed so far in the section. At the end of each section, we have presented the same.
-
61MethodsVideo lesson
In this tutorial, we will see a very important topic in Java called Methods. There are various types of methods that are differentiated by the parameters passed or return type etc. In this tutorial parameterized methods and non-parameterized methods, are explained. Parameterized methods are which take any arguments (variables of any data type). These can be passed by reference or value. This will be studied further in the course.
Method in Java
In Java, Method is a block of code, which performs a specific task. It is also known as a function procedure.
"Methods" are blocks of code that can be used repeatedly by the programmer to reduce the complexity (length) of the code. There are various types of methods that are differentiated by the parameters passed or return type etc.
Method declaration has six component:
Modifiers – There are two types of modifiers in java. Access and Non-Access Modifiers
Access Modifiers are which control the scope of the defined function.
Access Modifiers are default, public, private, and protected.
Non-Access Modifiers provide additional features.
There are final, static, transient, synchronized, volatile
The return Type – The return type for the method is always the returned data type and if the return type is void, then it returns nothing.
Method Name – It should be according to the naming convention decided by Java.
Parameters – parameters are for taking input from the user. You can provide a comma-delimited list of parameters, the parameter is optional, you can use empty parenthesis if there is no parameter.
Method body – It is always enclosed between braces “{ }” and contains the code for functionality.
Methods reduce the code size and increase the reusability of the code.
Parameterized Method
This is a way of passing value from the user. Parameterization is also used to define some variables inside the method block.
Using parameterization above example can be written as
The variable step is responsible for the initial value of the loop.
The variable ‘final_value’ is responsible for the final value up to which the loop will execute.
-
62Methods parameters and return typeVideo lesson
This tutorial deals with parameters and returns types of the methods. The parameters are the variables or arguments passed to the function to be used in our program. The return type is the data type of the variable that is returned to the main function (it is not mandatory since the function can also be invoked from an external function).
Method Parameters & Return Type
Here we will deal with the parameters and return type of the method. Return type parameter which could be a value, object, or any data structure is returned by the method after the completion of its execution. The “return” keyword is used to return a value from a method.
A method can return primitive or non-primitive type value.
A method can return only a single It may or may not contain multiple values.
The “return” keyword ideally is the last statement of the method but it could also feature anywhere in the given code depending upon the code. Once the return statement is executed, the program returns to the code from where the method is called. Code written after the return statement will not be executed, it will give you a compile-time error.
-
63Method overloading - Part 1Video lesson
This tutorial deals with the concept of method overloading. Method overloading in simple words is a set of methods that have the same name but should have atleast one of the following parameters which are unique to the method. The parameters are return type, parameters passed, and the sequence of parameters. If methods have any one of the above features which is unique to them then multiple methods can share the same name.
Method Overloading
In Java, Method overloading allows having multiple methods with the same name, if they differ in the number of arguments.
Method overloading can be achieved in the following ways:
Differs in numbers of parameter
Differs in the data type of parameters
Differs in the order of parameters.
Note: Method overloading cannot be achieved by changing the return type.
-
64Method overloading - Part 2Video lesson
The above-given properties are verified by certain examples by taking a different number of parameters and also different datatypes for the same method name.
In this tutorial, we will check Method Overloading with the help of simple examples. The following methods will be achieved in the following ways.
Method Overloading with different number of parameter
Method overloading with a different data type of parameter
Method overloading with the difference in order of parameters.
This programming exercise defines all of these methods with a clear explanation of the concept.
-
65EXERCISE on methodVideo lesson
In this tutorial, we will create a method to check the number is prime or not. To do so in our program we will create a class that will handle the floating-point values as well in our program logic. The following program explanation is provided in this lecture.
-
66Project filesText lesson
These are all the source codes of the programs discussed so far in the section. At the end of each section, we have presented the same.
-
67Quiz on Section 7Quiz
Quiz Consists:
Multiple Choice questions.
True or false type questions.
Practice program: Identify output.
-
68Code Block, Indentation and statementsVideo lesson
Code blocks have been discussed earlier. A code block is a piece of code that is surrounded by curly braces '{}' which mark the start and end of the piece of code.
Indentation is the proper arrangement of the code by tabs or spaces such that the code is readable. It could also be done automatically by the eclipse editor which is shown in the video.
In addition, some tips and tricks about the editor are discussed here.
-
69Java literalsText lesson
-
70Quiz on section 8Quiz
Quiz Consists:
Multiple Choice questions.
True or false type questions.
Practice program: Identify output.
