本文介绍了是“类型",但像“变量"一样使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我是C#的新手,并且遇到了一些语法问题.下面的代码行将引发此错误"...是'Type',但其用法类似于'Variable'

I'm new to C# and am having some syntax issues. The following line of code is throwing this error "... is a 'Type' but is used like a 'Variable'

返回 LoanSubAccount(AddSubAccount( LoanSubAccount ()));

我确定是否分配了AddSubAccount( new LoanSubAccount ());到一个变量并返回它,那将起作用.我不明白的是为什么我拥有的东西不起作用?

I'm sure if I assigned AddSubAccount(new LoanSubAccount()); to a variable and returned it, that would work. What I don't understand is why what I have doesn't work?

谢谢

普雷斯顿

< SNIPPET>

私有 SubAccount AddSubAccount( SubAccount 帐户){

private SubAccount AddSubAccount(SubAccount Account) {

SubAccountID = GetNextSubAccountNumber();

SubAccounts.Add(SubAccountID,Account);

返回 GetSubAccount(SubAccountID);

return GetSubAccount(SubAccountID);

}

LoanSubAccount AddLoanAccount(){

LoanSubAccount AddLoanAccount() {

返回 LoanSubAccount(AddSubAccount( LoanSubAccount ()));

return LoanSubAccount(AddSubAccount(new LoanSubAccount()));

}

推荐答案


这篇关于是“类型",但像“变量"一样使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 04:37