Рет қаралды 164,546
Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
Udemy Courses:
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
Java For Programmers:- bit.ly/javaProgrammers
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
In this lecture we are discussing:
1)Assignment operator
a) = is used to assign a value to a variable
b) += is used to assign a value to a variable by adding it to the existing value
c) -= is used to assign a value to a variable by subtracting it from the existing value
-- there are many but in this lecture we discussing only some
e.g of =
int num1=11;
int num2=12;
int result = num1 + num2;
int result1=num1-num2;
int result2=num1*num2;
int result3=num1/num2;
e.g of +=
int num=1;
num +=1; = num = num+1;
num +=5; = num = num+5;
e.g of -=
int num2=2;
num -=1; num =num-1;
num -=5; num =num-5;
2)increment and decrement operator
-- there are two type of increment and decrement operator
a) pre
b) post
-- post increment and decrement operator
int num=1;
num++;
System.out.println(num); // 2
-- this operator is known as post increment operator
num--;
System.out.println(num); //1
-- this operator is know as post decrement operator
-- pre increment and decrement operator
int num=2;
++num;
System.out.println(num);//3
--num;
System.out.println(num);//2
Difference between pre and post operator
e.g for that we take one example
int num=5;
System.out.println(num++); // 5 is print on console
int num1=5;
System.out.println(++num); //6 is printed on screen
in post
first assignment and then increment
e.g int num=5; int copy;
copy=num++; in this case first num=5 assign to copy then increment the num
copy value is 5;
in pre
first increment then assignment
e.g int num=5;
int copy;
copy = ++num;
in this case first increment num value from 5 to 6 then assign to copy.
copy value is 6;
Github repo : github.com/navinreddy20/Javac...
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com