Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 859763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:43:19+00:00 2026-05-15T08:43:19+00:00

What is the Smalltalk equivalent of Java’s static fields and methods? IOW, what do

  • 0

What is the Smalltalk equivalent of Java’s static fields and methods? IOW, what do the Smalltalkers do when they need class level data and/or methods?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:43:19+00:00Added an answer on May 15, 2026 at 8:43 am

    We use class-side methods/instance variables. A class is an object, after all, so can have methods.

    For instance, the Rectangle class has a method #origin:corner: so you may write

    Rectangle origin: 0@0 corner: 100@100
    

    to create a Rectangle. This is just the message #origin:corner: sent to the object called Rectangle (a class is an object!) with the two Points as parameters.

    Class-side instance variables work much the same way. A class, being an object, may have instance variables. From the SUnit library:

    TestCase class
      instanceVariableNames: 'history'
    

    and then TestCase class exposes this in the usual way, with a getter/setter (#history and #history:).

    EDIT: The @ I used has caused a fair bit of discussion. It’s what’s called a binary message, which allows one to define selectors that look just what other languages would call infix operators. For instance, 3 + 4, or 0@0. In the case of @, the Number class defines a method called @ taking a parameter y, defined as ^Point x: self y: y – “return a Point whose x coordinate is my own value and whose y coordinate is the parameter”.

    Point is an ordered pair, but of course there’s nothing stopping one from defining higher-dimensional versions. Point might define a method called @ that looked like this, for instance: ^Triple x: self x y: self y z: z – “return a point in R^3 whose x, y coordinates are my own, and whose z coordinate is the given parameter”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder why smalltalk doesn't make use of java-style inner class. This mechanism effectively
Looking for a Smalltalk compiler that given Smalltalk (Instantiations) will emit either Java bytecode,
I need some smalltalk with GUI for my homework, and I'm running Mac OS
In Newspeak's IDE, Hopscotch, what is the equivalent to Smalltalk's alt-n, which shows you
I noticed that the Smalltalk language has no concept of private/protected methods. All methods
Hi I have text editor widget in smalltalk (visual works) that returns a text
I am trying to compare two strings in Smalltalk, but I seem to be
I have a Dictionary of objects I have created in smalltalk, which I am
How do I disable garbage collection messages with GNU Smalltalk 3.0.5 stable? Also, is
I'm writing a brush for Alex Gorbatchev's Syntax Highlighter to get highlighting for Smalltalk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.