Announcement

Collapse
No announcement yet.

OnTheFly Classes in a Method (Function)

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

  • 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);

         }


    | VFX Artist, C++ Programmer, HW Overclocker | Web: xgiovio.com Email: xgiovio@gmail.com Twitter: @xgiovio

  • #2
    Originally posted by jonymalik33
    Thanks for posting in this forum Good Luck

    ---------------------
    Mohsin
    you are welcome. have a nice and thanks for your comment.
    | VFX Artist, C++ Programmer, HW Overclocker | Web: xgiovio.com Email: xgiovio@gmail.com Twitter: @xgiovio

    Comment

    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