Results 1 to 9 of 9

Thread: Dynamic Classes

  1. #1
    nunofaria is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default Dynamic Classes

    Hi, I'm starting to study how to program dynamic classes (if that's what it's called)

    Is it possible to add a field or a method to a class on execution time?

    I'm starting to see some papers related to 'ClassLoader' but they're a bit confusing.

    Any help/directions is appreciated.
    Thanks.

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    You can dynamically load a class using ClassLoader that can be specified at run-time, and, with introspection, you could discover what members and methods that class has and create instances of that loaded class.
    My Hobby Project: LegacyClone

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,568
    Rep Power
    12

    Default

    If you add fields or methods wouldn't it be a different class?

    What is the actual problem you are trying to solve? There arebytecode libraries that allow the generation of classes at runtime.

  4. #4
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    Java is dynamic and all of its classes are unless you make them static........Do you know the difference between static and dynamic.....it is 1 and one is a binary number......: static just means the compiler isn't allowed to move it around......and that alll classes on that program have access to that variable and can change the value of that static variable without permisssiom [i e public private or classs path] ; hmmmmmmmmmmmmmmm think
    Last edited by aaroncarpet; 11-17-2009 at 07:03 AM. Reason: typo

  5. #5
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    did i say that right fubarable??????????

  6. #6
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    unless it is private static.....then only the declaring class can affect thst dtstic vsrisnle

  7. #7
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    owhat avout "stoic" tpes fuerable

  8. #8
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    first you must learb the differebce between static and dynamic equilibrium........chemistry

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Dynamic GUI
    By ike2u in forum New To Java
    Replies: 4
    Last Post: 08-08-2009, 03:50 AM
  2. dynamic inherence
    By itaipee in forum Advanced Java
    Replies: 6
    Last Post: 02-07-2009, 02:05 PM
  3. Dynamic Table using JSP
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-27-2008, 04:13 AM
  4. Help for dynamic classes
    By Bender in forum Advanced Java
    Replies: 1
    Last Post: 12-19-2007, 09:46 PM
  5. dynamic update in swt
    By sandor in forum SWT / JFace
    Replies: 0
    Last Post: 05-14-2007, 09:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •