Top 1,000 Features Creators Resources Extensions Blog Explorer CSV Download
GitHub icon

Classes

< >
Example from 2 languages: JavaScript, TypeScript
class Person {}
Example from 1 languages: Python
class Person (object): def __init__(self, name): self.name = name
Example from 1 languages: Ruby
# A tiny Person class in Ruby: class Person attr_accessor :name, :age, : # getter and setter methods def initialize(name, age) @name = name @age = age end end # Create a new Person object: person = Person.new("John", 30) puts person.name puts person.age # Change the age of the person: person.age = 35 puts person.age
*

Languages with Classes include JavaScript, Python, Java, C++, Ruby, PHP, TypeScript, C#, PowerShell, Swift, Scala, Haskell, Kotlin, CoffeeScript, Dart, Crystal, Reason, Groovy, OCaml, Chapel, F#, ABAP, SystemVerilog, Clean, X10, Angelscript, Apex, JS++, Speedie, Aardvark

*

Languages without Classes include C, C3, progsbase, C2

*

View all concepts with or missing a hasClasses measurement

*

Read more about Classes on the web: 1.

View source

- Build the next great programming language About Acknowledgements Part of the World Wide Scroll