Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

static class python

#To create a static method, just add "@staticmethod" before defining it.

>>>class Calculator:
    # create static method
    @staticmethod
    def multiplyNums(x, y):
        return x * y

>>>print('Product:', Calculator.multiplyNums(15, 110))
Product:1650
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #static #class #python
ADD COMMENT
Topic
Name
8+7 =