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
  1. Home
  2. General Programming
  3. Java
  4. Java

Java

Scheduled Pinned Locked Moved Java
questionjava
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zakarie mukhtar abdi
    wrote on last edited by
    #1

    what is the advantage of declaring each variable in separate line?

    Zaki

    L Richard DeemingR V 3 Replies Last reply
    0
    • Z zakarie mukhtar abdi

      what is the advantage of declaring each variable in separate line?

      Zaki

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      None at all.

      1 Reply Last reply
      0
      • Z zakarie mukhtar abdi

        what is the advantage of declaring each variable in separate line?

        Zaki

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        What is the advantage of posting the same message over and over again?! :mad: Java1 - Java Discussion Boards[^] - 6th October - "what is the advantage of declaring each variable in separate line?" Java1 - Java Discussion Boards[^] - 22nd December - "what is the advantage of declaring each variable in separate line?" Java - Java Discussion Boards[^] - 22nd December - "what is the advantage of declaring each variable in separate line?" You were given the answer back in October. It hasn't changed in the last two months.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        L 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          What is the advantage of posting the same message over and over again?! :mad: Java1 - Java Discussion Boards[^] - 6th October - "what is the advantage of declaring each variable in separate line?" Java1 - Java Discussion Boards[^] - 22nd December - "what is the advantage of declaring each variable in separate line?" Java - Java Discussion Boards[^] - 22nd December - "what is the advantage of declaring each variable in separate line?" You were given the answer back in October. It hasn't changed in the last two months.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          It's a way of trying to get the answer you want. ;)

          1 Reply Last reply
          0
          • Z zakarie mukhtar abdi

            what is the advantage of declaring each variable in separate line?

            Zaki

            V Offline
            V Offline
            vishaljamdagni
            wrote on last edited by
            #5

            It is one of those good practices which you're asked to follow while writing your code because it makes a lot cleaner and concise code. This is similar as to why we programmers focus so much on indentation... Because whenever you're working on a big project chances are you may not be the only person working on it, so if someone else has to review your code it'll be a lot easier for him/her to get a reference as to where was each variable declared. Because you might be well aware of the haunting NullPointerException which just pops out of no where and can be really trick to negotiate if your code isn't clear. Hope this helps. Cheers.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

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