Error CS1002 :; Expected - I have a semicolon. :(

Attempted to create a new instance of the MortgageData object.

The professor said:

ClassName InstanceName = New ClassName(arg1, arg2, arg3, arg4);

I used

MortgageData somethingsomething = New MortgageData(ID,principal,apr,term);

Continue to receive error message CS1002 :; Expected with the class name after a new underscore in red. I am using visual studio 2008.

Not sure what to do.

+3
source share
3 answers

To start, write newinstead new. C # keywords are case sensitive and always lowercase!

+15
source

The correct answer has already been accepted there, but I would like to add a general point here:

<x> . - , , , , .

+4

newdifferent from newdifferent from new.

Use lower case new.

+3
source

Source: https://habr.com/ru/post/1749860/


All Articles