+ 2
Is array an object ?
17 ответов
+ 9
Mohit Sharma Include relevant TAGS!!
An array, in the context of Java, is a dynamically-created object that serves as a container to hold constant number of values of the same type.
+ 8
Mohit Sharma
• In Java, no variable can ever hold an object.
• A variable can only hold a reference to an object.
There is a special portion of memory called 》the heap《 where objects live.
Instead of holding an object itself, a variable holds the information necessary to find the object in memory. This information is called a reference or pointer to the object.
In effect, a reference to an object is the address of the memory location where the object is stored. When you use a variable of object type, the computer uses the reference in the variable to find the actual object.
+ 8
Danijel Ivanović your suggestion to use advanced search inspired me to add a Custom Search bar to my site preset to only provide results from Sololearn. I hope the community finds this helpful!
https://www.freecodeexamples.com/2018/12/sololearn-advanced-search.html?m=1
+ 8
+ 7
Hello, 😊
Can you specifying your question correctly!
Use the search bar!
https://www.sololearn.com/post/10362/?ref=app
Please, read our guidelines:
https://www.sololearn.com/discuss/1316935/?ref=app
An useful code for any new user here!;)
https://code.sololearn.com/WvG0MJq2dQ6y/
+ 7
In fact most of the collection types in Java which are the part of java.util package use arrays internally in their functioning. Since Arrays are objects, they are created during runtime. The array length is fixed.
+ 7
Mohit Sharma
Before asking a question on the Q/A,
try to search :
• Google Advenced Search :
Set domain to 》sololearn.com《 for search only on the SoloLearn
https://www.google.com/advanced_search
• Eclipse Wiki :
"Before asking a question on the forums"
https://wiki.eclipse.org/Before_asking_a_question_on_the_forums
https://code.sololearn.com/W26q4WtwSP8W/?ref=app
+ 7
What is the difference between public, protected, package-private and private in Java?
https://stackoverflow.com/questions/215497/what-is-the-difference-between-public-protected-package-private-and-private-in
Controlling Access to Members of a Class
https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
+ 7
bobbie 😊👍Great! 😄💪👏👏👏👌🍻
+ 6
Mohit Sharma 👍😉
Have a nice Coding! ;)😊
+ 4
Here is an excellent explanation for this question:
https://www.geeksforgeeks.org/array-primitive-type-object-java/
+ 3
David Carroll so much thank u sir
+ 3
Mohit Sharma The protected members will remain protected and accessible by all sub classes in the inheritance hierarchy.
A sub class is able to explicitly increase the visibility of a protected member by overriding the member with a public accessor.
NOTE: The visibility of a member can only be increased, not decreased. So... a protected member would not be able to be overridden as private and, therefore, hidden from any of its child classes.
+ 2
Is array an object in Java ?
Because an array in Java is created using keyword "new" which is also used to create objects of class..
That's I am confused...
+ 2
Okay sir, if it is an object, then of which class??
+ 2
Ohh sorry sir, I didn't know the rules.I will care about it.
+ 1
One more question, If a protected member of a class gets inherited in its subclass, what would be its access modifier in sub claa? Will it still be protected or will it be changed to something else.?