Scalar variables in Java

Discussion in 'Java' started by Martin, Jun 19, 2008.

  1. Martin

    Martin Guest

    Hi,

    if someone refers to scalar variables in Java, what exactly is he
    including? Is it equal to primitive types plus String? Or maybe
    without String? Definitely not an array, right? Or can you not really
    use this term for Java?

    I only found Perl-related stuff about this.

    TIA
    Martin
     
    Martin, Jun 19, 2008
    #1
    1. Advertising

  2. "Martin" <-berlin.de> wrote in message
    news:...
    > Hi,
    >
    > if someone refers to scalar variables in Java, what exactly is he
    > including? Is it equal to primitive types plus String? Or maybe
    > without String? Definitely not an array, right? Or can you not really
    > use this term for Java?
    >
    > I only found Perl-related stuff about this.
    >
    > TIA
    > Martin


    "Scalar variable" is not just Perl terminology, no. Tcl uses the
    terminology, and it's also a reasonably common term in Transact-SQL. If I
    heard it used in Java it would mean (to me) what it means elsewhere - a
    single-valued variable, as opposed to multiple-values (arrays, typically).

    AHS
     
    Arved Sandstrom, Jun 19, 2008
    #2
    1. Advertising

  3. Martin

    Stefan Ram Guest

    Martin <-berlin.de> writes:
    >if someone refers to scalar variables in Java,
    >what exactly is he including?


    While used inadvertently once in the Java Language Specification,
    Third Edition within an example, »scalar« is not being defined
    by the Java Language Specification, Third Edition.

    Therefore, if anyone applies this to Java entities, the
    meaning of »scalar« solely depends on his discretion.
    So he needs to define it or possibly be asked about it.

    In C, arithmetic types and pointer types are collectively
    called scalar types. Since reference values are pointers,
    by this, the only non-scalar type of Java would be »boolean«,
    but it makes no sense to apply a term of another programming
    language to Java literally.
     
    Stefan Ram, Jun 19, 2008
    #3
  4. Martin

    Arne Vajhøj Guest

    Stefan Ram wrote:
    > Martin <-berlin.de> writes:
    >> if someone refers to scalar variables in Java,
    >> what exactly is he including?

    >
    > While used inadvertently once in the Java Language Specification,
    > Third Edition within an example, »scalar« is not being defined
    > by the Java Language Specification, Third Edition.
    >
    > Therefore, if anyone applies this to Java entities, the
    > meaning of »scalar« solely depends on his discretion.
    > So he needs to define it or possibly be asked about it.
    >
    > In C, arithmetic types and pointer types are collectively
    > called scalar types. Since reference values are pointers,
    > by this, the only non-scalar type of Java would be »boolean«,
    > but it makes no sense to apply a term of another programming
    > language to Java literally.


    There are a lot of English words not defined in the JLS where
    you would still have expectations about the meaning in Java
    context.

    I would say that scalar is such a term. It is all
    types with just a single value.

    WikiPedia says:
    http://en.wikipedia.org/wiki/Scalar_(computing)
    and C is just used as an example.

    Arne
     
    Arne Vajhøj, Jun 20, 2008
    #4
  5. In article <485b1569$0$90265$>,
    Arne Vajhøj <> wrote:

    > Stefan Ram wrote:
    > > Martin <-berlin.de> writes:
    > >> if someone refers to scalar variables in Java,
    > >> what exactly is he including?

    > >
    > > While used inadvertently once in the Java Language Specification,
    > > Third Edition within an example, »scalar« is not being defined
    > > by the Java Language Specification, Third Edition.
    > >
    > > Therefore, if anyone applies this to Java entities, the
    > > meaning of »scalar« solely depends on his discretion.
    > > So he needs to define it or possibly be asked about it.
    > >
    > > In C, arithmetic types and pointer types are collectively
    > > called scalar types. Since reference values are pointers,
    > > by this, the only non-scalar type of Java would be »boolean«,
    > > but it makes no sense to apply a term of another programming
    > > language to Java literally.

    >
    > There are a lot of English words not defined in the JLS where
    > you would still have expectations about the meaning in Java
    > context.
    >
    > I would say that scalar is such a term. It is all
    > types with just a single value.
    >
    > WikiPedia says:
    > http://en.wikipedia.org/wiki/Scalar_(computing)
    > and C is just used as an example.


    For comparison, a similar meaning is used in Ada: "Scalar types comprise
    enumeration types, integer types, and real types." [ARM 3.5]
    Effectively, scalar refers to things with just a single value.

    Certainly, the definitions are not identical, but the term scalar is
    conceptually useful. How would it not meaningfully refer to the Java
    primitive types? [JLS 4.2]

    --
    John B. Matthews
    trashgod at gmail dot com
    home dot woh dot rr dot com slash jbmatthews
     
    John B. Matthews, Jun 20, 2008
    #5
  6. Martin

    Roedy Green Guest

    On Thu, 19 Jun 2008 00:55:03 -0700 (PDT), Martin
    <-berlin.de> wrote, quoted or indirectly quoted someone
    who said :

    >if someone refers to scalar variables in Java, what exactly is he
    >including? Is it equal to primitive types plus String? Or maybe
    >without String? Definitely not an array, right? Or can you not really
    >use this term for Java?


    see http://mindprod.com/jgloss/scalar.html
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jun 20, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack Dowson
    Replies:
    1
    Views:
    324
    Chris Dollin
    May 1, 2007
  2. Replies:
    9
    Views:
    1,015
  3. Clint Olsen
    Replies:
    6
    Views:
    410
    Jeff 'japhy' Pinyan
    Nov 13, 2003
  4. Jaap Karssenberg
    Replies:
    21
    Views:
    320
    Brian McCauley
    Jul 2, 2004
  5. Mark

    Replace scalar in another scalar

    Mark, Jan 27, 2005, in forum: Perl Misc
    Replies:
    4
    Views:
    195
    Arndt Jonasson
    Jan 27, 2005
Loading...

Share This Page