Questions Concepts
GitHub icon


Classes - language feature

< >
class Person {}
Example from Python, Cython:
class Person (object): def __init__(self, name): = name
Example from 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 ="John", 30) puts puts person.age # Change the age of the person: person.age = 35 puts person.age

Languages with Classes include Java, JavaScript, Python, C++, PHP, Ruby, C#, Swift, Scala, Kotlin, PowerShell, Haskell, TypeScript, Dart, Reason, Crystal, CoffeeScript, F#, OCaml, Groovy, Chapel, ABAP, X10, Clean, SystemVerilog, Cython, Speedie, Angelscript, Pizza, Apex, JS++, Oracle Java, Deesel, Real-Time Concurrent C, Static Typescript

Languages without Classes include C, Objective-C, C3, progsbase, C2, Tick C

This question asks: Does the language have a concept of classes?

Read more about Classes on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Traffic Traffic Today Day 305 Logout