How to pass class name as parameter to a function in android?
<p>In my android application, I have two classes, say X and Y.I have another class Z and inside that class I have a static function 'print'.This function should be called from both classes, X and Y and I want to pass class name of X and Y as parameters to the function 'print' when I call print function from both classes.What I have tried is,</p>

<pre><code>public class X
 {
  public static String os="Android";
  String classname="X";
  Z.print(classname);
 }

public class Y
  {
   public static String os="IOS";
   String classname="Y";
   Z.print(classname);
  }

public class Z
  {

     public static void print(String classname)

      {

       System.out.println(classname.os);

      }
  }
</code></pre>

<p>But eclipse throws an error "os cannot be resolved or is not a field".I know the method I have used for passing class name is wrong.Can anyone guide me to solve this problem?...Thanks in advance.... </p>
