Question: As a rule in object-oriented paradigm, a static method can have access only to static variables and static methods. If it is so, an obvious question arises as to how can the main() method in Java has access to non-static members (variables or methods) even though it is specifically public static void...!!!

Answer: 
The main method does not have access to non-static members either. 

```
public class Snippet
{
   private String instanceVariable;
   private static String staticVariable;

   public String instanceMethod()
   {
      return "instance";
   }

   public static String staticMethod()
   {
      return "static";
   }

   public static void main(String[] args)
   {
      System.out.println(staticVariable); // ok
      System.out.println(Snippet.staticMethod()); // ok

      System.out.println(new Snippet().instanceMethod()); // ok
      System.out.println(new Snippet().instanceVariable); // ok

      System.out.println(Snippet.instanceMethod()); // wrong
      System.out.println(instanceVariable);         // wrong 
   }
}

```
You have to instantiate the object you wish to access.

For example

```
public class MyClass{

  private String myData = "data";

  public String getData(){
     return myData;
  }

  public static void main(String[] args){
     MyClass obj = new MyClass();
     System.out.println(obj.getData());
  }
}

```