Pokémon X and Y Fan Community
April 18, 2024, 08:09:41 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Home Help Search Arcade Gallery SHOUTBOX Staff List Calendar Members Login Register  

Programming Thread

Pages: 1 2 [3] 4 5 ... 12
  Send this topic  |  Print  
Author Topic: Programming Thread  (Read 3499 times)
0 Members and 3 Guests are viewing this topic.
Shihen
Magical Misdreavus
****

Level: 5
Offline Offline

Posts: 126


View Profile WWW
Badges: (View All)
« Reply #30 on: November 25, 2012, 02:38:07 pm »

Oh god. I don't understand python classes. I don't get the __init__ thing either. This could delay my learning :/
I hate doing classes in Python, it's so weird. the __init__ is just the constructor (code that's executed when a object is created from the class) method. Comparing it to Java:

Code:
public class myClass{
      public myClass(){
             System.out.println("New Object");
      }
}

Is Python's equivelent of:
Code:
class myClass:
       def __init__(self):
              print("New Object")
Report Spam   Logged

Pages: 1 2 [3] 4 5 ... 12
  Send this topic  |  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
Free SMF Hosting - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.056 seconds with 17 queries.