Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By JosAH

Thread: Storing variables in registers

  1. #1
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Storing variables in registers

    Is there any method of storing variables in registers e.g in c++ by using keyword register ?

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: Storing variables in registers

    sure, in native code. Java applications don't know about the physical machine and shouldn't know about the physical machine; only about the Java VM. Behind the scenes the JVM might just be doing just that though. But you shouldn't care. Just write dumb Java code and you'll be fine.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,538
    Blog Entries
    7
    Rep Power
    20

    Default Re: Storing variables in registers

    Even in C++ (and C), the register keyword is outdated; the compiler knows better than a human being. And don't start asking about 'auto' variables, nor 'goto', nor pass by reference.

    Jos
    gimbal2 likes this.
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: Storing variables in registers

    :) I know about auto ;) thanks

Similar Threads

  1. how to storing arbitrary collection of variables
    By HelpingIsCaring in forum New To Java
    Replies: 33
    Last Post: 07-24-2013, 06:03 PM
  2. Storing objects
    By paul1024 in forum New To Java
    Replies: 5
    Last Post: 04-30-2011, 06:12 AM
  3. Storing array?
    By LifeElixer in forum New To Java
    Replies: 7
    Last Post: 04-14-2011, 06:10 AM
  4. Storing data?
    By Syntax in forum New To Java
    Replies: 4
    Last Post: 01-23-2010, 01:17 AM
  5. What are Instance variables and static variables?
    By sandeshforu in forum New To Java
    Replies: 3
    Last Post: 09-09-2009, 05:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •