Arpa Mukherjee

Greenhorn
+ Follow
since Mar 05, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arpa Mukherjee

In java why an actual object of a particular class can be accessed only through a reference to that object? Why cant we get an actual object of a class, why it has to be accessed only by the pointer to that object?
10 years ago
I am very keen to know that whether the JAVA programs are executed by the JVM running in my environment or the processor of my system. I find it very confusing as in many books it is written that java programs are executed by the JVM. I can understand that the JVM is interpreting the compiled "bytecode" but whether it even does the job of processing or not isnt clear to me. If so then how does the JVM performs the role of a processor??
10 years ago
@Ulf Dittmer:
Here by specifying an outside entity i did not mean something within the same package.
I know that default is accessible by any outside entity within the same package. But what i want to know is why there is a need to specify public modifier to the main method? If by without making the class public, JVM can access the members of that class then it can surely access the members even if you give default access modifier. Then what is the necessity of declaring it public???
10 years ago
As we know in java if a class cannot be accessed, its members can never be accessed too. So if a class is not given the public modifer the methods of that can never be accessed by any outside entity. I dont know whether there is an exception for static methods or not. But if the answer is no, then what is the logic behind giving the main method a public modifier? Because the class within which i am enclosing my main method is not public. So theoretically JVM being an outside entity cannot access the main method even if it is declared as public and static. But my programs are still running. How this happen??
10 years ago
Arrays are meant to be objects in java, and in OOP object derives its behaviour and state from its corresponding class. So what is the corresponding class of an array? for example when i write,
int[] arr=new int[5];
arr is a reference variable pointing to an actual array object. So what is the class of this array arr?
10 years ago