Thread: Idiots

Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1 Idiots 
    I_-_I
    Guest
    was talking to this one idiot on msn, he was acting like he knew EVERYTHING, so i asked him about import static, and guess what? he logged

    so il explain what import static can be used for.

    we will use this test class:
    Code:
    public final class JClass {
    
       private static final ActionHandler HANDLER_ACTION;
    
        static {
            HANDLER_ACTION = new ActionHandler();
        }
    
        public static void doAction() {
            HANDLER_ACTION.IDKAMETHODNAME(IDKSOMEARGS);
        }
    
    }
    now lets make a class that uses the static method JClass has
    Code:
    import static JClass.doAction; 
    
    public final class TestClass {
    
        public TestClass() {
    
        }
    
        public void testVoid() {
            doAction();
        }
    
    }
    see the import static
    Code:
    import static JClass.doAction;
    you can say this 'imports that method'
    so instead of JClass.doAction(), you can just do doAction()

    this applies to almost anything with the static modifier(including variables as long as they are not private)

    so there now you know about static imports
     

  2. #2  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    660
    Discord
    View profile
    Rep Power
    5000
    so:
    import static System.out;

    println("Hi!")

    ?
     

  3. #3  
    I_-_I
    Guest
    Quote Originally Posted by Vastico View Post
    so:
    import static System.out;

    println("Hi!")

    ?
    no
    Code:
    import static java.lang.System.out;
    println isnt a static the out variable in System is tho
    so
    out.println("Hi!");
     

  4. #4  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    660
    Discord
    View profile
    Rep Power
    5000
    oh okay
     

  5. #5  
    I_-_I
    Guest
    Quote Originally Posted by Call of Duty View Post
    Light you act like you know everything so stop being a hypocrite u dum jew
    lol he was arguing with me when he doesnt understand java at all, sounds like u dont either, jealousy isnt cool bruh
     

  6. #6  
    Registered Member
    rmb7's Avatar
    Join Date
    Nov 2008
    Posts
    1,023
    Thanks given
    2
    Thanks received
    12
    Rep Power
    200
    thats cool never knew that. Could be very helpful in cleaning up your server.
     

  7. #7  
    I_-_I
    Guest
    Quote Originally Posted by rmb7 View Post
    thats cool never knew that. Could be very helpful in cleaning up your server.
    mmhm np
     

  8. #8  
    Renown Programmer

    Sean's Avatar
    Join Date
    May 2007
    Age
    29
    Posts
    2,758
    Thanks given
    264
    Thanks received
    1,089
    Rep Power
    4393
    Quote Originally Posted by Call of Duty View Post
    Light you act like you know everything so stop being a hypocrite u dum jew
    your very cocky arnt you, even when your a dumb idiot
     

  9. #9  
    Renown Programmer and Respected Member
    Maxi's Avatar
    Join Date
    Jun 2008
    Posts
    3,201
    Thanks given
    281
    Thanks received
    1,093
    Rep Power
    1366
    Quote Originally Posted by Call of Duty View Post
    Light you act like you know everything so stop being a hypocrite u dum jew
    Nice troll lolol
     

  10. #10  
    Aza
    Aza is offline
    Banned

    Join Date
    May 2008
    Posts
    2,583
    Thanks given
    99
    Thanks received
    22
    Rep Power
    0
    Cool, If I ever get around to using, I think this will shorten all my classes and make them a lot neater
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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