Question about Static and Dynamic Types in Java

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alic

    Question about Static and Dynamic Types in Java

    Hi, I am trying to understand static and dynamic types. In a program, if I
    had two variables that have the same static type, but different dynamic
    types. How can I assign each variable to the other using two assignment
    statements? I tried creating a short program attempting this without
    success. Could someone locate me to an program example on the web
    describing something as such. It does not have to do any input or output.
    Thanks
  • Raymond DeCampo

    #2
    Re: Question about Static and Dynamic Types in Java

    Alic wrote:[color=blue]
    > Hi, I am trying to understand static and dynamic types. In a program, if I
    > had two variables that have the same static type, but different dynamic
    > types. How can I assign each variable to the other using two assignment
    > statements? I tried creating a short program attempting this without
    > success. Could someone locate me to an program example on the web
    > describing something as such. It does not have to do any input or output.
    > Thanks[/color]

    Why don't you post the code you tried, and what was wrong with it.

    Ray

    --
    XML is the programmer's duct tape.

    Comment

    • Hal Rosser

      #3
      Re: Question about Static and Dynamic Types in Java


      "Alic" <alic2301@hotma il.com> wrote in message
      news:Xns95FC6E7 C3C6DFalic2301h otmailcom@216.7 7.188.18...[color=blue]
      > Hi, I am trying to understand static and dynamic types. In a program, if[/color]
      I[color=blue]
      > had two variables that have the same static type, but different dynamic
      > types. How can I assign each variable to the other using two assignment
      > statements? I tried creating a short program attempting this without
      > success. Could someone locate me to an program example on the web
      > describing something as such. It does not have to do any input or output.
      > Thanks[/color]

      If you could clarify, or re-phrase your question - you would probably answer
      it yourself.


      Comment

      Working...