Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

ATE_Engineer

@ATE_Engineer
About
Posts
4
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Consultant / contract programmers how are you found?
    A ATE_Engineer

    Have you tried elance.com?

    The Lounge csharp tools question learning

  • Your first experience with a PC! ..or any computer!
    A ATE_Engineer

    My first experience with a computer was in college, programming class in Fortran using punch cards! (1978 or 1979) My first experience on a "Non-Mainframe" computer was on a Fluke 1620 (?? Model number) Controller. This was a small, rack-mounted, computer that had an IEEE-488 Port (a.k.a. GPIB) to control test instrumentation. This was programmed in interpretive Basic but had the ability to create compiled Fortran functions, that you could then call from Basic. (about 1982) My first experience on a "Personal" computer was an "original" IBM-PC: 8086 processor running at 4.77MHz with 256Kbytes of memory and a dual 5 1/4 Floppy drive (360K). This I also programmed in interpretive Basic (BASICA). (about 1983)

    The Lounge com question

  • Java - Sharing data across classes
    A ATE_Engineer

    I think you can accomplish this with a class variable. A class variable is on that only has one instance and is shared between all copies of the class. It is a variable in the class that is declared outside the scope of all the methods of the class and has the static modifier in it's declaration. An example:

    public class ClientClass
    {
    public static Vector userNames = new Vector(0, 1);

    public ClientClass(String userName)
    {
    userNames.add(userName);
    }

    public Vector getUserNames()
    {
    return userNames;
    }

    }

    Use of above:

    ClientClass client1 = new ClientClass("user 1");

    ClientClass client2 = new ClientClass("user 2");

    Vector users1 = client1.getUserNames();
    Vector users2 = client2.getUserNames();

    In the above both users1 and users2 should be the same.

    IT & Infrastructure java game-dev sysadmin help tutorial

  • Brace style
    A ATE_Engineer

    I much prefer the latter, code is easier to follow... Now a follow-up question for those that prefer the latter style: Which do you use/prefer when there is only one executable statement after an 'if' or 'else'? Style 1-

    if (this)
    doThis();
    else
    doThat();

    OR Style 2-

    if (this)
    {
    doThis();
    }
    else
    {
    doThat();
    }

    Me? I use Style 2. Yes it takes up more space, but I think it is more readable and is less prone to error if later adding another statement to the if or else section(s). (I just noticed that this question was discussed a bit earlier in the thread... sorry for the repeat) -- modified at 9:53 Thursday 17th May, 2007

    The Lounge com question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups