Results 1 to 6 of 6
  1. #1
    thagentleman is offline Member
    Join Date
    Oct 2008
    Posts
    7
    Rep Power
    0

    Default Structs Question

    Does anyone know how to initialize and declare variables using structs??

    Thanks in advance

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Are we talking C++ or are we talking Java here??

  3. #3
    thagentleman is offline Member
    Join Date
    Oct 2008
    Posts
    7
    Rep Power
    0

    Default

    preferably Java.

  4. #4
    Paul Richards is offline Member
    Join Date
    Oct 2008
    Location
    UK
    Posts
    65
    Rep Power
    0

    Default

    Java does not have structs, so you use classes instead.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Well then of course you know that Java doesn't have structs. So the short answer is "you can't". The long answer will depend on you restating your question in greater detail mainly concentrating on what your ultimate goal with the code is.

  6. #6
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default No pointers, struct, or union in Java

    As far as I know, struct don't exist in Java. Found the following which might help (shows struct equivalent using classes):
    C Data Types Not Supported By the Java Language
    Last edited by CJSLMAN; 10-12-2008 at 09:36 PM.
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Similar Threads

  1. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 08:49 AM
  2. question
    By zizou147 in forum New To Java
    Replies: 13
    Last Post: 07-04-2008, 07:05 PM
  3. question on jsp
    By munigantipraveen in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-30-2008, 02:47 PM
  4. Need help on this question
    By Deon in forum New To Java
    Replies: 3
    Last Post: 01-27-2008, 03:58 PM
  5. question about rmi
    By leonard in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 04:19 AM

Posting Permissions

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