#71 What is Annotation in Java

  Рет қаралды 60,246

Telusko

Telusko

Күн бұрын

Telusko Courses:
Spring and Microservices Live Course : bit.ly/springmslive
Coupon: TELUSKO25 (25% Discount)
Industry-Ready Java Spring Microservices Developer Live : bit.ly/JavaMS2
Complete Java Developer Course : bit.ly/Comp-Java-Dev-2
Coupon: TELUSKO20 (20% Discount)
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 What is Annotations?
#2 What does annotations provide to program?
#3 How annotation prevent us from logical error?
1)
What is Annotations?
-- annotation is type of comment which is used to provide meta data to the compiler and JVM about the program.
Basic difference between comment and annotations
-- annotation is used to provide meta data to the compiler and JVM about the program but comment is used to provide information to the programmer.
2)
What does annotations provide to program and what does for program?
-- Annotations are used to provide supplemental information about a program.
-- Annotations start with ‘@’.
-- Annotations do not change the action of a compiled program.
-- Annotations help to associate metadata (information) to the program elements i.e. instance variables, constructors, methods, classes, etc.
-- Annotations are not pure comments as they can change the way a program is treated by the compiler. See below code for example.
3)
How annotation prevent us from logical error?
class A{
public void show(){
System.out.println("In A");
}
public void display(){
System.out.println("In A");
}
}
class B extends A{
@Override
public void show(){
System.out.println("In B");
}
/* @Override
public void displayData(){
System.out.println("In B");
}
*/
//here you get error because you are not overriding the method of parent class but you are using @Override annotation
// if you are thinking I can override display() method but you should defined new method but whenever you mention @override compiler throw error that you are not override the parent class method
//it helps to avoid the logical error in the program because logical error is more difficult to find when you use annotation it helps to find the logical error
//because solving problem at compile time error is easy than solving problem at runtime
}
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

Пікірлер: 24
@guitarDad100
@guitarDad100 Жыл бұрын
Good information. It's going to take me a while to watch all your new lessons. Thanks for sharing.
@omdobariya7971
@omdobariya7971 11 ай бұрын
Best of all! I appreciate your great help to thousands of learners out there with such effective content... A Big Thanks Sir
@jobijose5397
@jobijose5397 Жыл бұрын
Very Nice Explanation. Thanks
@KarthikBhatl
@KarthikBhatl 6 ай бұрын
One of the best teacher and good human out there!
@gideonebubechukwu7194
@gideonebubechukwu7194 8 ай бұрын
Great video
@samarthtandale9121
@samarthtandale9121 Жыл бұрын
Great video 🤠🙌🏼
@ashirwadkatkamwar5555
@ashirwadkatkamwar5555 3 ай бұрын
superb explaination
@MoeMoe-qr7od
@MoeMoe-qr7od 4 ай бұрын
[00:00](kzbin.info/www/bejne/Z6nYdXiGm9l-jJI) Annotations in Java provide metadata or extra information to the compiler or runtime, aiding in code interaction without changing functionality. [02:33](kzbin.info/www/bejne/Z6nYdXiGm9l-jJI) Logical problems in programming, known as bugs, can arise when expectations differ from outcomes, emphasizing the importance of debugging. [04:00](kzbin.info/www/bejne/Z6nYdXiGm9l-jJI) Annotations, like "@Override," enable developers to indicate intentions to the compiler, facilitating early error detection and debugging at compile time. [05:22](kzbin.info/www/bejne/Z6nYdXiGm9l-jJI) Annotations play a significant role in frameworks like Hibernate and Spring, offering various annotations for methods, variables, and classes to enhance code clarity and functionality. [06:46](kzbin.info/www/bejne/Z6nYdXiGm9l-jJI) Developers can specify the retention level of annotations, such as compile-time or runtime, to determine their applicability beyond compilation, particularly useful in frameworks.
@harshithagurram2880
@harshithagurram2880 Жыл бұрын
Thanks
@rakipalivela64
@rakipalivela64 Жыл бұрын
Thanks mann
@dhruvyadav3492
@dhruvyadav3492 28 күн бұрын
thankss sir now i understoood agter searching 10 times on web loll
@pakistaninsaudi
@pakistaninsaudi 4 ай бұрын
working in programming from almost 8 years writting code, had no idea this thing exists
@adilwise
@adilwise 8 ай бұрын
Thanks for sharing. But this does not explain what annotations are in themselves. What are they? How do they behave behind the scene? Are they classes? Are they interfaces?
@ankurpremmasih8207
@ankurpremmasih8207 Жыл бұрын
Which ide is this?
@codewithmaheshhbalwan
@codewithmaheshhbalwan Жыл бұрын
Visual Studio Code
@uday2159
@uday2159 Жыл бұрын
My brain almost fix when we type long methods they gets into a bug 😂😂even they are right. Loll..
@svasanth6470
@svasanth6470 Жыл бұрын
this is not a bug the two method names are different. u missed "s" in Belongs in class B
@seanbhrim
@seanbhrim Жыл бұрын
That's a bug...human errors including misspellings cause bugs. That was his point.
@aakashsinha9641
@aakashsinha9641 Жыл бұрын
I was saying the same, S is missing in belongs
@richardharris202
@richardharris202 Ай бұрын
3:25😂
@madhankumarmadhankumar3226
@madhankumarmadhankumar3226 8 ай бұрын
so twist is 's'😅
@AbSen17
@AbSen17 25 күн бұрын
methods name different
@YashRajput-gj6zf
@YashRajput-gj6zf Жыл бұрын
Haha..I almost write the comment that there is no method overriding.....hence calling the method of class A will call the method A same goes for class B. These mistake is common specially when you working with many classes were annotation helps a lot!!
#72 Functional Interface New in Java
3:34
Telusko
Рет қаралды 72 М.
15.8 Annotation in Java part 1 | Basics
8:34
Telusko
Рет қаралды 196 М.
I’m just a kid 🥹🥰 LeoNata family #shorts
00:12
LeoNata Family
Рет қаралды 2,5 МЛН
Spring Annotations for Experienced Developers #springboot #java
10:51
Dictionary in Python
12:24
Telusko
Рет қаралды 1,3 МЛН
Generics in Java
14:26
Telusko
Рет қаралды 499 М.
Fade In on Scroll | HTML, CSS & JS Tutorial
4:40
Codecka
Рет қаралды 4,6 М.
Java Reflection Explained - bɘniɒlqxƎ noiɟɔɘlʇɘЯ ɒvɒᒐ
20:07
Coding with John
Рет қаралды 171 М.
What is Agile?
15:22
Telusko
Рет қаралды 979 М.
#40 Encapsulation in Java
11:42
Telusko
Рет қаралды 137 М.
После ввода кода - протирайте панель
0:18
Cadiz smart lock official account unlocks the aesthetics of returning home
0:30
Дени против умной колонки😁
0:40
Deni & Mani
Рет қаралды 13 МЛН
#miniphone
0:16
Miniphone
Рет қаралды 3,3 МЛН
Настоящий детектор , который нужен каждому!
0:16
Ender Пересказы
Рет қаралды 435 М.