Mukoyonzo 0 Newbie Poster 17 Years Ago Hi, am using C# to program. I declared my property as below public decimal sal(string amount) { get{return sal;}} Now on running I got the error sal is declared as property not method What should I do? 0 0 Reply with Quote Share Recommended Answers Collapse Answers Answered by Ramy Mahrous 401 in a post from 17 Years Ago Sure that's wrong! What shall you write a method or a property?? Method Copy to Clipboardpublic decimal sal(string amount) { //your method body //return value/variable } Property Copy to Clipboardpublic decimal sal { get{return sal;}} Jump to Post All 2 Replies Ramy Mahrous 401 Postaholic Featured Poster 17 Years Ago Sure that's wrong! What shall you write a method or a property?? Method Copy to Clipboardpublic decimal sal(string amount) { //your method body //return value/variable } Property Copy to Clipboardpublic decimal sal { get{return sal;}} 0 0 Reply with Quote Share Jugortha -1 Junior Poster 17 Years Ago ok there is a difference between properties, indexes and method I advise u should to see a OO tutorial 0 0 Reply with Quote Share Share Facebook Twitter LinkedIn Reply to this topic Be a part of the DaniWeb community We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge. Sign Up — It's Free!
Ramy Mahrous 401 Postaholic Featured Poster 17 Years Ago Sure that's wrong! What shall you write a method or a property?? Method Copy to Clipboardpublic decimal sal(string amount) { //your method body //return value/variable } Property Copy to Clipboardpublic decimal sal { get{return sal;}} 0 0 Reply with Quote Share
Jugortha -1 Junior Poster 17 Years Ago ok there is a difference between properties, indexes and method I advise u should to see a OO tutorial 0 0 Reply with Quote Share