In Java the access rights (public
/private
etc.) are managed by the compiler and the Java Virtual Machine (JVM). e.g If you load a Java library you can dynamically change the access rights to a field and make it public
. There's no immediate hardware analogue.
There are so many layers between a Java program and the hardware that this question is very difficult to answer. Java code results in Java bytecode (similar to machine code), and you don't have direct memory access. The JVM provides this interface and recompiles code into machine code as required but that's largely hidden from you.
If you're interested in the interface between hardware and software I would look at writing some code in C and C++, and the resultant machine code/assembler that is generated. C/C++ are much closer to the hardware and will give you an appreciation of what's going on.