class Person {}
class Person (object):
def __init__(self, name):
self.name = name
# 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
class
Languages with Classes include JavaScript, Python, Java, C++, Ruby, PHP, TypeScript, C#, PowerShell, Swift, Scala, Kotlin, Haskell, CoffeeScript, Dart, Crystal, Reason, Chapel, Groovy, F#, OCaml, ABAP, SystemVerilog, Clean, X10, Angelscript, Apex, JS++, Speedie, Aardvark, Simula 67
Languages without Classes include C, C3, Lil, progsbase, C2, SAKO
View all concepts with or missing a hasClasses measurement
Read more about Classes on the web: 1.