Why a class can't be private & protected ? || Core Java FAQs Videos

  Рет қаралды 46,829

Naresh i Technologies

Naresh i Technologies

Күн бұрын

Пікірлер: 41
@NareshIT
@NareshIT 5 жыл бұрын
Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
@richcohen5936
@richcohen5936 7 жыл бұрын
A class can be private. Why? Because we can take as many inner classes and they can have private modifier. An outer class can’t be private or protected..
@mohamedrawoof5093
@mohamedrawoof5093 4 жыл бұрын
A class can be a private and it’s an just access modifier. The private class for Singleton object is make sense but not for other normal classes. Mentioning private modifier for Singleton object is to protect the class not to instanciate.
@vv7205
@vv7205 4 жыл бұрын
sir i am Prepareing Eect so Object type Question kavali
@probot143
@probot143 2 жыл бұрын
What is not inherited from parent class ?
@vasudevkodali8566
@vasudevkodali8566 4 жыл бұрын
1.If default is allowed, why protected is not allowed.. In fact, protected is more visible than defalut 2.Ok.. Grand parent can't be protected, but why children can't be protected..?
@MrPraveenBasavaraj
@MrPraveenBasavaraj 7 жыл бұрын
A class can be private in case of inner classes.
@divyeshkumarbalar7732
@divyeshkumarbalar7732 5 жыл бұрын
yes, it can be inner class
@user-tz7xc4fe3u
@user-tz7xc4fe3u 6 жыл бұрын
nice explanation pleace continue thanks sir
@dnyaneshwarsartape2745
@dnyaneshwarsartape2745 5 жыл бұрын
It is all about outer class.
@ShivKumar-yv9ti
@ShivKumar-yv9ti 6 жыл бұрын
default also not visible out side the world but we can make default class
@Dawnsunflower156
@Dawnsunflower156 4 жыл бұрын
beta kuch cheezon ko bs package level tk rkhne k liye hi default ka prayog kiya jata hai...private,protected agr kr b denge to ghum fir k woi hoga class bahr nhi ja paegi,,to jb default ye functionality de rha h to ambiguous ku bnana system ko,,isiliye ise allow hi nhi kiya gaya
@hhcdghjjgsdrt235
@hhcdghjjgsdrt235 Жыл бұрын
@@Dawnsunflower156 beta ?
@Dawnsunflower156
@Dawnsunflower156 Жыл бұрын
@@hhcdghjjgsdrt235 I am a teacher😅😅
@hhcdghjjgsdrt235
@hhcdghjjgsdrt235 Жыл бұрын
@@Dawnsunflower156 sorry mam
@empty3161
@empty3161 4 жыл бұрын
sir i am from uttarakhand. you are explaning very good.
@shaheenshaikh6701
@shaheenshaikh6701 6 жыл бұрын
protected means in same package and derived clsses can access so how can we say that in same package it will be a parent child relation only?
@gauravgupta9477
@gauravgupta9477 4 жыл бұрын
Correct Correct....It can be accessed from a non-child class as well inside the same package. I was searching if someone else has raised this doubt or not.
@afshakhan4589
@afshakhan4589 6 жыл бұрын
loved that way u said "paper" 😂😊
@armanchaudhari4767
@armanchaudhari4767 5 жыл бұрын
😂😂😂
@shankar1373
@shankar1373 4 жыл бұрын
😂😂😂
@krishnashauzshenikala9240
@krishnashauzshenikala9240 5 жыл бұрын
Very easy explanation sir
@somnathghosh1211
@somnathghosh1211 7 жыл бұрын
finally i understood...thanks sir
@shashanknaag4910
@shashanknaag4910 4 жыл бұрын
Very Informational
@pavanbirajdar2329
@pavanbirajdar2329 7 жыл бұрын
very nice explanation
@vinodkale7045
@vinodkale7045 7 жыл бұрын
Very nice expliantion
@srirammandadapu6793
@srirammandadapu6793 6 жыл бұрын
but by default class is private in oops for ensuring the concept of data hiding
@harikrishnahkb
@harikrishnahkb 6 жыл бұрын
It is wrong In Java default is not private, In Java default is "package level access"
@vanipattar3931
@vanipattar3931 3 жыл бұрын
Sir only you are giving examples to understand but technically not explained.
@nagarajuuppalapati1421
@nagarajuuppalapati1421 7 жыл бұрын
Good Explanation...
@miteshjain56
@miteshjain56 6 жыл бұрын
god bless u sir
@shivamkamdi6822
@shivamkamdi6822 3 жыл бұрын
Thank you sir .!!!
@samarthgupta2985
@samarthgupta2985 2 жыл бұрын
Thank u
@AKHILDS-j3v
@AKHILDS-j3v 6 жыл бұрын
thanks sir..........................tsmuch...
@namankapoor1
@namankapoor1 6 жыл бұрын
Your explanation for protected is wrong.
@srikanthpeddina192
@srikanthpeddina192 6 жыл бұрын
y?, whats wrong tl?
@keleleberhie6525
@keleleberhie6525 5 жыл бұрын
@@srikanthpeddina192 protected members can be also accessed by any classes within the same package!!
@gauravgupta9477
@gauravgupta9477 4 жыл бұрын
@@keleleberhie6525 Correct Correct....but still i didn't understand why can't we make class protected.
@keleleberhie6525
@keleleberhie6525 4 жыл бұрын
@@gauravgupta9477 Why do you need to defined a class as protected? I can't see the need for that. In my understanding, I can classify oops access modifiers into two categories 1) package level(public, default) 2) class level(private, default, protected, public) But let me give you a way to answer it by asking you. #If you need your class to be protected what would be the usage public access modifier?!
@ubaidansari3409
@ubaidansari3409 5 жыл бұрын
thanks
@deepthipapa914
@deepthipapa914 7 жыл бұрын
what is he talking... is he teaching english or java?
Why static block executes before main () || Core Java FAQs Videos
7:05
Naresh i Technologies
Рет қаралды 49 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Interview Question | Comparable vs Comparator in Java
12:58
Telusko
Рет қаралды 648 М.
Explain about public static void main(String[] args); ( PART- I )
28:14
DURGA EDUCATION
Рет қаралды 672 М.
Difference between "== operator" and "equals() method"  in java?
6:37
DURGA EDUCATION
Рет қаралды 447 М.
JVM Architecture
27:35
Durga Software Solutions
Рет қаралды 558 М.
Creation of Stack in DS | Data Structures Tutorial
32:22
Naresh i Technologies
Рет қаралды 414 М.
Difference between Interface and Absract Class
16:57
DURGA EDUCATION
Рет қаралды 972 М.