Announcement

Collapse
No announcement yet.

OnTheFly Classes in a Method (Function)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • xgiovio
    replied
    Originally posted by jonymalik33
    Thanks for posting in this forum Good Luck

    ---------------------
    Mohsin
    you are welcome. have a nice and thanks for your comment.

    Leave a comment:


  • xgiovio
    started a topic OnTheFly Classes in a Method (Function)

    OnTheFly Classes in a Method (Function)

    Create 2 otf classes and use them in a main (same for another method)
    PHP Code:
    public class test {

        public static 
    void main(String[] input){


            
    ////// on-the-fly classes
           
    class ExampleObject {
                 public 
    void set_data(int in_data){
                     
    data=in_data;
                 }
                 public 
    int get_data(int in_data){
                    return 
    data;
                 }

                 private 
    int data 0;
           }

           class 
    ModifyExampleObject{
               
    ModifyExampleObject(ExampleObject objint value){
                   
    obj.set_data(value);
               }
           }
            
    ////// END on-the-fly classes



            /* Normal expression */ 
    final int samplevalue 10;
           
    /* Normal expression */ new ModifyExampleObject(new ExampleObject(),samplevalue);

         }


Working...
X

Google Profile


My name is Giovanni Di Grezia, but people call me xgiovio.

Here is my homepage:.

I'm a VFX Artist and Software Developer.

Giovanni Di Grezia