package com.valami; public class Ferrari { private int v = 0; private void alam() { System.out.println(\"alam\"); } public Ferrari() { System
As long as the private variable is in the same class as the main() method, then the main() method has access to it. In general, even static methods have access to private fields of instances of the same class.