Core Java With OCJP/SCJP: Innerclass Part- 2||normal innerclass||regular innerclass

preview_player
Показать описание
java
Basic Java Tutorial for beginners
Basic Java Programming for beginners
Core Java By Durga Sir
Core Java
Core Java Video Tutorials
Core Java Tutorial for beginners with examples
Core Java Tutorial
Core Java DURGASOFT
Durgasoft Core Java
Durgasoft Java
durga software solutions core java videos
durga software solutions java
How to learn java
How to learn java programming language for beginners
learn java
learn java programming for beginners
programming in java
understanding java
java application development tutorial
java beginner tutorial
java basics for beginners
java for beginners
java lessons
java lectures
java language tutorial for beginners
java programming tutorial
java programming for beginners
java tutorial for beginners
java tutorial
java tutorial by durga sir
====================================
Java tutorial by durga sir

Java 9 by durga sir

Java 1.8 Version New Features by Durga sir

Adv Java JDBC Tutorial by Durga sir

OCJA 1.8 Java SE 8 Programmer - I (1Z0 - 808 ) By Durga sir

Core Java by NagoorBabu sir

Advenced Java by Nagoorbabu sir

CoreJava by Ratan

Advanced Java jdbc by Ratan

Advjava tutorials - JSP by Ratan

Adv java servlets tutorial by ratan

Servlet and JSP Tutorial by anji reddy

Advanced Java Jdbc by Anjireddy

Hibernate byAnjireddy

Struts by Anjireddy

Spring by Mr.AnjiReddy

ADV JAVA by Naveen

Spring by Mr.Naveen

Hibernate by Mr. Naveen

Struts by Mr.Naveen
Рекомендации по теме
Комментарии
Автор

Sir, its 2024 .. and i still watch your videos when i have to refer any java concept... You are far better than those bhaiya and didi channels teaching these languages without explaining the core concepts and fleecing students.. Sheer example of OLD IS GOLD..

kartikeybajpai
Автор

2020 Update: Its good to understand the general concept, however questions at the end of the video, do not hold water after Java 8. As you can access the local members of the enclosing block from inside the inner class method (if they are final or effectively final). This works in Java 8 and above try yourself.



public class Test {
int i =10;
static int j = 99;

public void mi(){
int k =100;
final int m = 40;
class Inner1{
public void m2(){
System.out.println(i +" " + j +" "+ k+ " "+ m);

}
}
Inner1 i = new Inner1();
i.m2();
}

public static void main(String[] args) {
Test t = new Test();
t.mi();
}
}

dinkarinjosh
Автор

[1.8V + versions] At 1:04:00, we can access local variables but they need to final either explicitly of implicitly(i.e once assigned cannot change)

MrCoder-xjyi
Автор

1:05:00
After Java 8 local variable doesn't not need to declare Final explicitly, but It should be effectively final.
Effectively Final means value of local variable should not change inside that method.

highwaylife_.
Автор

you have the gift of maa Saraswathi. you are one of the fabulous teacher I ever seen in my life..

sumitbhardwaj
Автор

1:23:36 static method inside inner class is valied from java 8 onwards. Beginners plz cross check this point.

tharunkumar
Автор

Till JDK 7, Local inner class can access only final local variable of the enclosing block. However From JDK 8, it is possible to access the non-final local variable of enclosing block in local inner class.

Jasleen-jkqo
Автор

To all viewrs of 2020 There is an error at 1.02 with respect to jdk version.
Sir is explaining the concept with less then 1.8 verson that's why it will give error .But if u try to compile it in version greater then 8 it will compile. Successfully.

vishalvikram
Автор

world best teacher is durga sir.. love from bangladesh .

rokib_ru_cse
Автор

Again completed watching on sept 02, 2024 at 10.10 PM :)

ranveervaghela
Автор

1:05:00 program of calling local variable in Inner class I didnt got any error. Code worked fine without using final keyword.

aamirali
Автор

Hi durga sir,


Regarding Method local inner classes:

from 1.8V, we can access the local variable of the method in which inner class has been declared from the inner class. So the concept explained at 1:14:00 was brilliant but how come itz working from 1.8V may i know based on what functionality the local variable is being accepted?

eadunuripranay
Автор

Java means Durga Sir. Love you a lot sir <3.

AbdullahAlMamun-fhgs
Автор

In earlier versions of Java, within a non-static nested (inner) class, you couldn't declare static members, methods, or fields directly. However, since Java 8, static methods and fields are allowed within a nested (inner) class if they are declared with the static keyword.

Dhiraj-ndvy
Автор

@DurgaSoftwareSolutions Time.Seek( 1:12:30 )
1.) Reference of inner class also gone when instance method(m1) gone from stack.
2.) when we call m2 method from m1 then m1 is also on stack as well as m2 is on stack, then is it possible to access m1 method variable inside m2 method (when can we access local variables of one method from other method, if both methods are available on stack) ??

v.r.
Автор

Very nice explanation but after java 1 . 8 version onwards we are not required to declare local variable as final to access them inside the inner class Or inner class method
Just keep them effectively final nothing else u can take final also no problem but it's not required
Just keep in mind don't modify that variable inside the inner class otherwise u will get compile time error
Saying : local variables referenced from an inner class must be final or effectively final

phgraviyt
Автор

Hello Sir,
I just tried 20 - 30 times my code not giving any error for your assertion @1:7:10(can't access local var(x) of method inside method local inner class)...please explain why.

its_asm
Автор

Sir as we can not access local inner class outside that method so how we can access method m2 of local inner class after completions of method m1 by local inner class object.

pratikshachauhan
Автор

Compiler will give left on right
Very decently😀😀

Lasaacademy
Автор

at 1:22:00 we can access instance method using class reference or object reference from static area, right ? so why can't we access i variable from inner class using object reference ?

gaganyadav