JavaFullStackNotes.pdf
JavaFullStackNotes.pdf
Frontend
Backend
Database
Software Companies
1) Product Based
2) Service Based
3) Outsourcing
=> Product Based Companies will develop projects/products and will sell those projects in market.
=> Service Based Companies will develop the projects based on client requirement.
=> Outsourcing companies will provide employees to other companies on contract basis.
2) Problem solving
3) System design
4) Design patterns
Service Based Companies
1) Coding
2) Fullstack development
Fullstack course
Daily Timings: 9 AM to 6 PM
Laptop is mandatory
Sunday is holiday
Course Content
Module-3 : Database
Module-4 : Frameworks
C : Create
R : Retrieve
U : Update
D : Delete
What is Backend?
Ex:
Backend Technologies:
Java
.Net
Python
PHP
Node JS
What is Frontend?
=> End Users will communicate with application using frontend only
Frontend Technologies:
Waterfall Model
3) Burden on Server
4) Maintenance
Microservices Architecture
-> Java Languages developed by a Team in Sun Microsystem. The teal lead is James
Gosling.
-> Sun Microsystem sold out to Oracle Company in 2010. Now Java is under license of
Oracle Corporation.
Link: https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe
2) Install Java software (Double click on .exe file -> Next -> Next -> Finish)
3) Set Path for Java up to JDK/bin directory (Open System Environment Variables)
4) Verify Java Installation (open command prompt and execute below command)
Step-1: Write Java Program and save it in a file with .java extension
Step-2: Compile Java Program using javac (It will generate .class file with byte code)
Step-3: Run .class file (JVM will start the program execution)
Note: JVM will convert byte code into machine understandable code.
Note: From Java 11v onwards, we can execute java program directly without compilation. This is
called as(Single Source File execution.
Comments:
We have the following comments in java:
-> The name we are using for classes, variables, methods is called as Identifier.
Rule - 1: It can contain upper case characters ( A - Z )
Rule - 5: Special characters only underscore (_) and dollar ($) allowed
Variable Name: start with lower case and from second word onwards every word first character as
Upper case
age = 20
price = 2000.50
name = ashok
gender = m
isEmp = true
=> Data Types are used to specify what type of data we can store into variable.
System.out.println(age);
System.out.println(id);
System.out.println(price);
System.out.println(status);
System.out.println(name);
=> To use Scanner class in our program first we need to import that class.
import java.util.Scanner;
Programs to Practise On Variables and Data Types
1) How to read data from keyboard and print that on console
6) Write a java program to calculate Rectangle Area by reading width and height from keyboard.
7) Write a java program to calculate simple interest by taking data from keyboard.
8) Write a java program to print reminder and quotient by taking two numbers from keyboard
9) Write a java program to convert meters into centi-meters and milli-meters (take meter from
keyboard).
10) Write a java program to calculate BMI by reading data from keyboard.
Operators
=> Operator is a symbol which is used to perform some operation on data
Arithmetic Operators: +, -, *, /, %
Assignment Operators: =
Ternary Operator: ? :
Unary Operators
class UnaryOperators {
int a = 25;
System.out.println(++ a); // 26
System.out.println (a ++ ); // 26 => a = 27
System.out.println(++ a); // 28
class UnaryOperators {
int a = 25;
System.out.println(++ a + a ++ ); //52
System.out.println(a); // 27
}
class UnaryOperators {
int a = 25;
System.out.println(++ a + a ++ + ++a ); // 80
System.out.println( --a ); // 27
class UnaryOperators {
int a = 35;
System.out.println( -- a ); // 34
System.out.println( a -- ); // 34 => a = 33
System.out.println(a) ; // 33
class UnaryOperators {
int a = 3;
2 +2 -1
System.out.println( -- a + a -- - a++); // 3
System.out.println(a) ; // 2
}
Arithmetic Operators
1) Addition ( + )
2) Substraction ( - )
3) Multiplication ( * )
4) Division ( / ) (Quotient)
5) Modula’s ( % ) (Reminder)
Relational Operators
=> To check relations among the data / variables and return result as true/false
3) Equality ( == )
4) Not Equals ( != )
Logical Operators
1) AND ( && ) => If all conditions are true then only result will be true
Assignment Operators
1) Equal ( = )
Ex : int a = 10;
Ternary Operator
int x = 15;
int y = 20;
int a = 10;
int b = 20;
int c = 35;
System.out.println(++a); // 11
System.out.println(a++); // 11 => a = 12
System.out.println(--a); // 10
System.out.println(a + b) ; // 30
System.out.println(a == b ); // false
System.out.println(a != b ); // true
int d = 10;
System.out.println(d);
int x = 5;
int y = 20;
}
Control Statements
1) Conditional Statements
1.1) Simple if
1.2) if - else
1.3) Nested - if
2) Looping Statements
2.3) do-while
2.4) for-each
3) Jumping Statements
3.1) break
3.2) continue
3.3) return
Simple if
Syntax :
if ( condition ) {
//statements
}
import java.util.Scanner;
class SimpleIf {
System.out.println("Enter Number");
int a = s.nextInt ( );
if ( a > 0 ){
System.out.println("Done....");
if - else
Syntax :
if ( condition ) {
//stmts
}else {
// stmts
}
1) Write a java program to check given number is even or odd. Take number from keyboard.
import java.util.Scanner;
class EvenOdd{
System.out.println("Enter Number");
int a = s.nextInt ( );
if( a % 2 == 0 ){
System.out.println("Even");
}else{
System.out.println("Odd");
2) Write a java program to print "Hello" if given number is divisible by 5 otherwise print "Bye".