package com.valami;
public class Ferrari
{
private int v = 0;
private void alam()
{
System.out.println(\"alam\");
}
public Ferrari()
{
System
Because main is static and your class hasn't been instantiated.
e.g., you have no Ferrari object to access. You must create a Ferrari object then access it's members. static main is a special static function. You can think of it as sort of separate if you want. So if you moved your main method outside of Ferrari you would expect that you would have to create an instance of Ferrari to use it... same deal here.