Search:

Type: Posts; User: helloworld922

Search: Search took 0.42 seconds.

  1. Re: Accessing a method of one class in another class

    ... It works for me.

    Here's the full code I'm using:


    public class Test
    {
    public static void main(String[] args)
    {
    String classname = "t1";
  2. Re: Accessing a method of one class in another class

    The class Class has a generic type. You can use a wild-card because you don't know what type it's suppose to be.


    Class<?> classDefinition = Class.forName(className);
  3. Re: Accessing a method of one class in another class

    preent isn't a method of type Object, you must type cast because the object has been polymorphed.


    maiin M = new maiin();
    Object O = M.createObject("t1");
    if (O instanceof t1)
    {
    //...
Results 1 to 3 of 3