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. C#
  4. compile problem

compile problem

Scheduled Pinned Locked Moved C#
helpquestion
9 Posts 5 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
    zeeShan anSari
    wrote on last edited by
    #1

    Hi, Consider the following class: class A{ private int i; private int j=8; private int k; { int i =j; } public Test1a(int k) { this.k=k } } ... program is not complie why?

    M D 2 Replies Last reply
    0
    • Z zeeShan anSari

      Hi, Consider the following class: class A{ private int i; private int j=8; private int k; { int i =j; } public Test1a(int k) { this.k=k } } ... program is not complie why?

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Because you missed a semicolon after this.k=k?

      Regards, mav -- Black holes are the places where God divided by 0...

      Z 1 Reply Last reply
      0
      • M mav northwind

        Because you missed a semicolon after this.k=k?

        Regards, mav -- Black holes are the places where God divided by 0...

        Z Offline
        Z Offline
        zeeShan anSari
        wrote on last edited by
        #3

        this.k=k; ......... now

        I AM WORKING ON "PLOTTER ROBOT"(FYP).

        C 1 Reply Last reply
        0
        • Z zeeShan anSari

          Hi, Consider the following class: class A{ private int i; private int j=8; private int k; { int i =j; } public Test1a(int k) { this.k=k } } ... program is not complie why?

          D Offline
          D Offline
          dhans
          wrote on last edited by
          #4

          put semicolon at the end of the statement this.k=k;

          dhans

          Z 1 Reply Last reply
          0
          • Z zeeShan anSari

            this.k=k; ......... now

            I AM WORKING ON "PLOTTER ROBOT"(FYP).

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            Just curious: But didn't the compiler tell you that there was a missing semi-colon? If not what did it say?

            Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Follow up on hiring a software developer * The Value of Smaller Methods My website | blog

            P 1 Reply Last reply
            0
            • D dhans

              put semicolon at the end of the statement this.k=k;

              dhans

              Z Offline
              Z Offline
              zeeShan anSari
              wrote on last edited by
              #6

              it is my exam's question

              I AM WORKING ON "PLOTTER ROBOT"(FYP).

              1 Reply Last reply
              0
              • C Colin Angus Mackay

                Just curious: But didn't the compiler tell you that there was a missing semi-colon? If not what did it say?

                Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Follow up on hiring a software developer * The Value of Smaller Methods My website | blog

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                Argghhhh - it was an examination question. Really, do we want numpties like this unleashed on the workforce if they can't spot something simple like this?

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                C 1 Reply Last reply
                0
                • P Pete OHanlon

                  Argghhhh - it was an examination question. Really, do we want numpties like this unleashed on the workforce if they can't spot something simple like this?

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  C Offline
                  C Offline
                  Colin Angus Mackay
                  wrote on last edited by
                  #8

                  Pete O'Hanlon wrote:

                  Really, do we want numpties like this unleashed on the workforce if they can't spot something simple like this?

                  In the OP's defence *takes own temperature*, before the compiler warned about missing semi-colons I could be looking at the screen for ages before spotting it. This was especially true in Borland's Turbo C++ (The fist C++ compiler that I used which was DOS based) as it would find fault with everything after the line with the missing semi-colon because it would just get really confused. And I spent ages tracking down dozens of errors that didn't exist. However, given the small size of the code, it should be easy to spot a missing semi-colon.

                  Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Follow up on hiring a software developer * The Value of Smaller Methods My website | blog

                  P 1 Reply Last reply
                  0
                  • C Colin Angus Mackay

                    Pete O'Hanlon wrote:

                    Really, do we want numpties like this unleashed on the workforce if they can't spot something simple like this?

                    In the OP's defence *takes own temperature*, before the compiler warned about missing semi-colons I could be looking at the screen for ages before spotting it. This was especially true in Borland's Turbo C++ (The fist C++ compiler that I used which was DOS based) as it would find fault with everything after the line with the missing semi-colon because it would just get really confused. And I spent ages tracking down dozens of errors that didn't exist. However, given the small size of the code, it should be easy to spot a missing semi-colon.

                    Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Follow up on hiring a software developer * The Value of Smaller Methods My website | blog

                    P Offline
                    P Offline
                    Pete OHanlon
                    wrote on last edited by
                    #9

                    Colin Angus Mackay wrote:

                    This was especially true in Borland's Turbo C++ (The fist C++ compiler that I used which was DOS based) as it would find fault with everything after the line with the missing semi-colon because it would just get really confused. And I spent ages tracking down dozens of errors that didn't exist.

                    Ah, but experience in those days used to show that clearing one error would normally clear a couple of hundred errors, which was why I always used to start at the errors at the top of the failure to see if they could be the culprit. 9 times out of 10, the error was in the top 2.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    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