Can we override static method in Java? | Core Java Interview Questions | Naresh IT

preview_player
Показать описание
Can we override static method in Java? | Core Java Interview Questions | Naresh IT

💡 Visit Our Website for Classroom Training:
💡 For Online Training:

--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

#JavaCourse #JavaTraining #JavaOnline #JavaTutorials
--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

YouTube have a bad algoritham . It just hides such super awesome content to the end user

damodaranm
Автор

Best explanation i have ever seen in my life

sarfarajansari
Автор

Your explanation is very clear sir, Thanks for the video

santhoshkaleru
Автор

Thank You Sir,
static method are can't override absolutely true,
Counter Question : how we can override static method ?
It's possible to override static methods,
using method hiding concept.

prashanttivhale
Автор

Excellent total differently explain sir new thoughts will come

krishnashauzshenikala
Автор

Thanks alot. I was very confused about this.

addis
Автор

So finally M1 method inherits to child class, I'm asking only about inheritance not about overriding...

sairamaraju
Автор

Superb but need some more real life explanation

shivamkumar-qser
Автор

Dislike because the explanation is incomplete to the point of being misleading.
The @Override annotation cannot be used on a static method, no. But you can do something that appears to be an override by simply creating a new static method of the same name in the child class, and that will compile and run. For very simple situations, it will do what would be expected.
Confusion will arise if you access the static method in the style of an instance method. Then someone used to clean object-oriented code will probably be surprised by which code is executed:
Parent myChild = new Child();
myChild.aStaticMethod(); // this will execute Parent.aStaticMethod(), not code within the instance's class

ComradeOgilvy
Автор

Is it mean static keyword opposes the Polymorphism?

neojai
Автор

Can We overload static methods in java?

yuvrajshinde
Автор

as per your theory static method cannot override in java, but as a official docs of java se, A class C inherits from its direct superclass all concrete methods m (both static and instance) of the superclass . who is correct ?
i find answer of it and mention here also
public class Box{

public static void f(){

}
}

class SmallBox extends Box{

public static void f(){

}
}
public class Example{

public static void main (String []args){

SmallBox.f();

}
}

answer=> prasann
here both methods are static and it override and method hinding is happend not modification. thankyou
guys verify your teacher whether he is correct or not. and sir please delete this video and remake it.

ShriJanardanSwamiMouli
Автор

I overrode the static method in child class and it doesn't give me any Error.

bsubliminalandfrequencies