Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Fern Sanchez   on Feb 10 In Java Category.

  
Question Answered By: Sudhakar Chavali   on Feb 10

I have a question

Can we consider below code as part of Late binding?

import java.lang.reflect.*;
public class Main
{
public static void main(String[] array) throws Exception
{
Class c= Class.forName("Child");
Method m=c.getMethod("test", String[].class);
Object t = c.newInstance();
Object o= m.invoke(t, new Object[]{array});
}
}

class Child extends Main
{
public void test(String[] array)
{
System.out.print("Hello Java World!!!");
}
}

Share: