News for hackers. Stuff that matters.
Re:Java Was Strongly Influenced by Objective-C by dminor on Thursday February 11, 2010 @08:41PM (#1119445)
Yes, although Java's reflection is somewhat of a pain in the ass and limited in many ways. But you can take a Class object and call newInstance(), and it will invoke the class's no-arg constructor.
Re:Java Was Strongly Influenced by Objective-C by duskwuff on Thursday February 11, 2010 @08:58PM (#1119490)
Moreover, reflection is less of a language feature and more of a very low-level library feature. In ObjC, one can write

    Class c = [SomeRandomClass class];
    id thingy = [[c alloc] init];
but Java won't let you do the equivalent:

    Class c = SomeRandomClass;
    Object x = new c;
Re:Java Was Strongly Influenced by Objective-C by vlisivka on Friday February 12, 2010 @03:57AM (#1120116)

  Class c = SomeRandomClass.class;
  Object x=c.newInstance();
Re:Java Was Strongly Influenced by Objective-C by duskwuff on Saturday February 13, 2010 @03:37PM (#1123506)
Yes, but that's making use of runtime magic (the Class class) which isn't used outside metaprogramming.