Error: returns void, a return keyword must not be followed by an object expressionReturns void, a return keyword must not be followed by an object expression C#How to use effective caching in .NET?async/await - when to return a Task vs void?I want to create 5 random numbers between 2 numbers and display in my textboxSince 'method' returns void, a return keyword must not be followed by an object expressionVisual C# Programming a Login form connected to a Access Db that gives only tries to log intoC# method failing to function for no known reasonreturn keyword must not be followed by an object expressionerror return keyword must not be followed by an object expressionReturns void, a return keyword must not be followed by an object expression C#Explicit explanation as to what a return type is, why void is necessary
Could the crash sites of the Apollo 11 and 16 LMs be seen by the LRO?
Getting fresh water in the middle of hypersaline lake in the Bronze Age
If a player tries to persuade somebody what should that creature roll not to be persuaded?
Why limit to revolvers?
Sending a photo of my bank account card to the future employer
Why does the Earth have a z-component at the start of the J2000 epoch?
Is there a way to handmake alphabet pasta?
Accidentally deleted python and yum is not working in centos7
Why did Steve Rogers choose Sam in Endgame?
What are "full piece" and "half piece" in chess?
What is the technical explanation of the note "A♭" in a F7 chord in the key of C?
line break after the word "proof" in proof environment
Is killing off one of my queer characters homophobic?
Why should I cook the flour first when making bechamel sauce?
Why does the Trade Federation become so alarmed upon learning the ambassadors are Jedi Knights?
Decoding Every Top 100 Voting Ever
Diminished chord constructed over the tonic degree?
When to ask for constructive criticism?
What are some symbols representing peasants/oppressed persons fighting back?
What alternatives exist to at-will employment?
Why don't commercial aircraft adopt a slightly more seaplane-like design to allow safer ditching in case of emergency?
Manually select/unselect lines before forwarding to stdout
Will it hurt my career to work as a graphic designer in a startup for beauty and skin care?
Construct a pentagon avoiding compass use
Error: returns void, a return keyword must not be followed by an object expression
Returns void, a return keyword must not be followed by an object expression C#How to use effective caching in .NET?async/await - when to return a Task vs void?I want to create 5 random numbers between 2 numbers and display in my textboxSince 'method' returns void, a return keyword must not be followed by an object expressionVisual C# Programming a Login form connected to a Access Db that gives only tries to log intoC# method failing to function for no known reasonreturn keyword must not be followed by an object expressionerror return keyword must not be followed by an object expressionReturns void, a return keyword must not be followed by an object expression C#Explicit explanation as to what a return type is, why void is necessary
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
private void QuestionAnswer_Load(object sender, EventArgs e)
txtQuestion.Enabled = false;
txtQuestion.BackColor = Color.White;
grpMultipleChoice.Enabled = false;
grpSingleChoice.Enabled = false;
btnCheckAnswer.Enabled = false;
btnNext.Enabled = false;
btnQuit.Enabled = false;
//force student to enter registration details
if (txtStudentName.Text == "" && txtStudentNumber.Text == "" && txtModuleNumber.Text == "")
btnStart.Enabled = false;
MessageBox.Show("You must enter your registration details at the upper right corner");
//declare a list
lstNumbers = new ArrayList();
//create a random number generator
Random rndNumber = new Random();
//generate 70 random numbers
//int number = (int)(rndNumber.NextDouble() * 69) + 1;
//lstNumbers.Add(number);
///use this counter to loop whenever a number is generated
int count = 0;
int maximumNumber = 69;
///disable answer button
btnCheckAnswer.Enabled = false;
do
int number = (int)(rndNumber.NextDouble() * maximumNumber) + 1;
lstNumbers.Add(number);
if (!lstNumbers.Contains(number))
lstNumbers.Add(number);
count++;
while (count <= 15 * 70);//
btnCheckAnswer_Click(sender, e);
return lstNumbers;//returns once list is built
Explanation:
I have created an arraylist that allows me generate randomly between 1-70 but noticed
my numbers where somewhat repeating. In a bid to prevent this, i noticed i was getting an
error message below:
Error 1 Since 'wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' returns void, a return keyword must not be followed by an object expression
i have tried everything i can to resolve this.the program runs well when i remove this
statement but shows duplicate values. Could you please help?
c# return
add a comment |
private void QuestionAnswer_Load(object sender, EventArgs e)
txtQuestion.Enabled = false;
txtQuestion.BackColor = Color.White;
grpMultipleChoice.Enabled = false;
grpSingleChoice.Enabled = false;
btnCheckAnswer.Enabled = false;
btnNext.Enabled = false;
btnQuit.Enabled = false;
//force student to enter registration details
if (txtStudentName.Text == "" && txtStudentNumber.Text == "" && txtModuleNumber.Text == "")
btnStart.Enabled = false;
MessageBox.Show("You must enter your registration details at the upper right corner");
//declare a list
lstNumbers = new ArrayList();
//create a random number generator
Random rndNumber = new Random();
//generate 70 random numbers
//int number = (int)(rndNumber.NextDouble() * 69) + 1;
//lstNumbers.Add(number);
///use this counter to loop whenever a number is generated
int count = 0;
int maximumNumber = 69;
///disable answer button
btnCheckAnswer.Enabled = false;
do
int number = (int)(rndNumber.NextDouble() * maximumNumber) + 1;
lstNumbers.Add(number);
if (!lstNumbers.Contains(number))
lstNumbers.Add(number);
count++;
while (count <= 15 * 70);//
btnCheckAnswer_Click(sender, e);
return lstNumbers;//returns once list is built
Explanation:
I have created an arraylist that allows me generate randomly between 1-70 but noticed
my numbers where somewhat repeating. In a bid to prevent this, i noticed i was getting an
error message below:
Error 1 Since 'wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' returns void, a return keyword must not be followed by an object expression
i have tried everything i can to resolve this.the program runs well when i remove this
statement but shows duplicate values. Could you please help?
c# return
you mean: return lstNumbers? i have tried that before stll show the squiggle on return.
– Zayn
Oct 11 '12 at 15:55
Unless you are programming in Visual Studio 2003 and C# 1, you should not be using an ArrayList. Use List<T> from System.Collections.Generic
– Anthony Pegram
Oct 11 '12 at 15:57
I would like to add that private void QuestionAnswer_Load(object sender, EventArgs e) is the method under which it falls. I have even tried changing void to string so i could return with a To String() but it still doesn't work
– Zayn
Oct 11 '12 at 16:02
Its on Visual studio 2012 @ Anthony
– Zayn
Oct 11 '12 at 16:04
It's been stated already that by using 'void' you are in essence saying that your function will return nothing. You need to specify the exact type of the object you intend to return. (Sorry my previous comment was c++ ... so I deleted it).
– user922475
Oct 11 '12 at 16:06
add a comment |
private void QuestionAnswer_Load(object sender, EventArgs e)
txtQuestion.Enabled = false;
txtQuestion.BackColor = Color.White;
grpMultipleChoice.Enabled = false;
grpSingleChoice.Enabled = false;
btnCheckAnswer.Enabled = false;
btnNext.Enabled = false;
btnQuit.Enabled = false;
//force student to enter registration details
if (txtStudentName.Text == "" && txtStudentNumber.Text == "" && txtModuleNumber.Text == "")
btnStart.Enabled = false;
MessageBox.Show("You must enter your registration details at the upper right corner");
//declare a list
lstNumbers = new ArrayList();
//create a random number generator
Random rndNumber = new Random();
//generate 70 random numbers
//int number = (int)(rndNumber.NextDouble() * 69) + 1;
//lstNumbers.Add(number);
///use this counter to loop whenever a number is generated
int count = 0;
int maximumNumber = 69;
///disable answer button
btnCheckAnswer.Enabled = false;
do
int number = (int)(rndNumber.NextDouble() * maximumNumber) + 1;
lstNumbers.Add(number);
if (!lstNumbers.Contains(number))
lstNumbers.Add(number);
count++;
while (count <= 15 * 70);//
btnCheckAnswer_Click(sender, e);
return lstNumbers;//returns once list is built
Explanation:
I have created an arraylist that allows me generate randomly between 1-70 but noticed
my numbers where somewhat repeating. In a bid to prevent this, i noticed i was getting an
error message below:
Error 1 Since 'wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' returns void, a return keyword must not be followed by an object expression
i have tried everything i can to resolve this.the program runs well when i remove this
statement but shows duplicate values. Could you please help?
c# return
private void QuestionAnswer_Load(object sender, EventArgs e)
txtQuestion.Enabled = false;
txtQuestion.BackColor = Color.White;
grpMultipleChoice.Enabled = false;
grpSingleChoice.Enabled = false;
btnCheckAnswer.Enabled = false;
btnNext.Enabled = false;
btnQuit.Enabled = false;
//force student to enter registration details
if (txtStudentName.Text == "" && txtStudentNumber.Text == "" && txtModuleNumber.Text == "")
btnStart.Enabled = false;
MessageBox.Show("You must enter your registration details at the upper right corner");
//declare a list
lstNumbers = new ArrayList();
//create a random number generator
Random rndNumber = new Random();
//generate 70 random numbers
//int number = (int)(rndNumber.NextDouble() * 69) + 1;
//lstNumbers.Add(number);
///use this counter to loop whenever a number is generated
int count = 0;
int maximumNumber = 69;
///disable answer button
btnCheckAnswer.Enabled = false;
do
int number = (int)(rndNumber.NextDouble() * maximumNumber) + 1;
lstNumbers.Add(number);
if (!lstNumbers.Contains(number))
lstNumbers.Add(number);
count++;
while (count <= 15 * 70);//
btnCheckAnswer_Click(sender, e);
return lstNumbers;//returns once list is built
Explanation:
I have created an arraylist that allows me generate randomly between 1-70 but noticed
my numbers where somewhat repeating. In a bid to prevent this, i noticed i was getting an
error message below:
Error 1 Since 'wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' returns void, a return keyword must not be followed by an object expression
i have tried everything i can to resolve this.the program runs well when i remove this
statement but shows duplicate values. Could you please help?
c# return
c# return
edited Oct 11 '12 at 15:58
Kache
6,1919 gold badges36 silver badges63 bronze badges
6,1919 gold badges36 silver badges63 bronze badges
asked Oct 11 '12 at 15:44
ZaynZayn
111 gold badge1 silver badge3 bronze badges
111 gold badge1 silver badge3 bronze badges
you mean: return lstNumbers? i have tried that before stll show the squiggle on return.
– Zayn
Oct 11 '12 at 15:55
Unless you are programming in Visual Studio 2003 and C# 1, you should not be using an ArrayList. Use List<T> from System.Collections.Generic
– Anthony Pegram
Oct 11 '12 at 15:57
I would like to add that private void QuestionAnswer_Load(object sender, EventArgs e) is the method under which it falls. I have even tried changing void to string so i could return with a To String() but it still doesn't work
– Zayn
Oct 11 '12 at 16:02
Its on Visual studio 2012 @ Anthony
– Zayn
Oct 11 '12 at 16:04
It's been stated already that by using 'void' you are in essence saying that your function will return nothing. You need to specify the exact type of the object you intend to return. (Sorry my previous comment was c++ ... so I deleted it).
– user922475
Oct 11 '12 at 16:06
add a comment |
you mean: return lstNumbers? i have tried that before stll show the squiggle on return.
– Zayn
Oct 11 '12 at 15:55
Unless you are programming in Visual Studio 2003 and C# 1, you should not be using an ArrayList. Use List<T> from System.Collections.Generic
– Anthony Pegram
Oct 11 '12 at 15:57
I would like to add that private void QuestionAnswer_Load(object sender, EventArgs e) is the method under which it falls. I have even tried changing void to string so i could return with a To String() but it still doesn't work
– Zayn
Oct 11 '12 at 16:02
Its on Visual studio 2012 @ Anthony
– Zayn
Oct 11 '12 at 16:04
It's been stated already that by using 'void' you are in essence saying that your function will return nothing. You need to specify the exact type of the object you intend to return. (Sorry my previous comment was c++ ... so I deleted it).
– user922475
Oct 11 '12 at 16:06
you mean: return lstNumbers? i have tried that before stll show the squiggle on return.
– Zayn
Oct 11 '12 at 15:55
you mean: return lstNumbers? i have tried that before stll show the squiggle on return.
– Zayn
Oct 11 '12 at 15:55
Unless you are programming in Visual Studio 2003 and C# 1, you should not be using an ArrayList. Use List<T> from System.Collections.Generic
– Anthony Pegram
Oct 11 '12 at 15:57
Unless you are programming in Visual Studio 2003 and C# 1, you should not be using an ArrayList. Use List<T> from System.Collections.Generic
– Anthony Pegram
Oct 11 '12 at 15:57
I would like to add that private void QuestionAnswer_Load(object sender, EventArgs e) is the method under which it falls. I have even tried changing void to string so i could return with a To String() but it still doesn't work
– Zayn
Oct 11 '12 at 16:02
I would like to add that private void QuestionAnswer_Load(object sender, EventArgs e) is the method under which it falls. I have even tried changing void to string so i could return with a To String() but it still doesn't work
– Zayn
Oct 11 '12 at 16:02
Its on Visual studio 2012 @ Anthony
– Zayn
Oct 11 '12 at 16:04
Its on Visual studio 2012 @ Anthony
– Zayn
Oct 11 '12 at 16:04
It's been stated already that by using 'void' you are in essence saying that your function will return nothing. You need to specify the exact type of the object you intend to return. (Sorry my previous comment was c++ ... so I deleted it).
– user922475
Oct 11 '12 at 16:06
It's been stated already that by using 'void' you are in essence saying that your function will return nothing. You need to specify the exact type of the object you intend to return. (Sorry my previous comment was c++ ... so I deleted it).
– user922475
Oct 11 '12 at 16:06
add a comment |
1 Answer
1
active
oldest
votes
Your method signature is:
private void QuestionAnswer_Load(object sender, EventArgs e)
The return type void means you can't/aren't planning to return anything. However, at the bottom, you have:
return lstNumbers;//returns once list is built
You're returning something! The compiler is complaining that you told it conflicting instructions. Either change the return type to ArrayList or do not return anything.
That being said, there are several improvements that could be made to the code to make it more readable, which will help you decipher problems, too. Consider submitting your code to https://codereview.stackexchange.com/.
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
|
show 2 more comments
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12843501%2ferror-returns-void-a-return-keyword-must-not-be-followed-by-an-object-expressi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your method signature is:
private void QuestionAnswer_Load(object sender, EventArgs e)
The return type void means you can't/aren't planning to return anything. However, at the bottom, you have:
return lstNumbers;//returns once list is built
You're returning something! The compiler is complaining that you told it conflicting instructions. Either change the return type to ArrayList or do not return anything.
That being said, there are several improvements that could be made to the code to make it more readable, which will help you decipher problems, too. Consider submitting your code to https://codereview.stackexchange.com/.
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
|
show 2 more comments
Your method signature is:
private void QuestionAnswer_Load(object sender, EventArgs e)
The return type void means you can't/aren't planning to return anything. However, at the bottom, you have:
return lstNumbers;//returns once list is built
You're returning something! The compiler is complaining that you told it conflicting instructions. Either change the return type to ArrayList or do not return anything.
That being said, there are several improvements that could be made to the code to make it more readable, which will help you decipher problems, too. Consider submitting your code to https://codereview.stackexchange.com/.
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
|
show 2 more comments
Your method signature is:
private void QuestionAnswer_Load(object sender, EventArgs e)
The return type void means you can't/aren't planning to return anything. However, at the bottom, you have:
return lstNumbers;//returns once list is built
You're returning something! The compiler is complaining that you told it conflicting instructions. Either change the return type to ArrayList or do not return anything.
That being said, there are several improvements that could be made to the code to make it more readable, which will help you decipher problems, too. Consider submitting your code to https://codereview.stackexchange.com/.
Your method signature is:
private void QuestionAnswer_Load(object sender, EventArgs e)
The return type void means you can't/aren't planning to return anything. However, at the bottom, you have:
return lstNumbers;//returns once list is built
You're returning something! The compiler is complaining that you told it conflicting instructions. Either change the return type to ArrayList or do not return anything.
That being said, there are several improvements that could be made to the code to make it more readable, which will help you decipher problems, too. Consider submitting your code to https://codereview.stackexchange.com/.
edited Apr 13 '17 at 12:40
Community♦
11 silver badge
11 silver badge
answered Oct 11 '12 at 15:54
KacheKache
6,1919 gold badges36 silver badges63 bronze badges
6,1919 gold badges36 silver badges63 bronze badges
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
|
show 2 more comments
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
Right. So change private void to private yourobject or private T if you want to keep the object returned undefined.
– user922475
Oct 11 '12 at 15:58
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
He sounds like he's very new to programming. I wouldn't suggest that he start writing generic methods just yet.
– Kache
Oct 11 '12 at 15:59
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
when i change method to private string QuestionAnswer_load(...., iget error..Error 1 'string wwTestAppV1.GenKnow.QuestionAnswer_Load(object, System.EventArgs)' has the wrong return type
– Zayn
Oct 11 '12 at 16:19
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
@annoying_squid; my object is lstNumbers right? its suppose to represent the list
– Zayn
Oct 11 '12 at 16:21
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
1stNumbers is an instance of your type ArrayList. Try private ArrayList QuestionAnswer_Load .. instead. You specify the type not the name of the instance. The compiler won't understand specific names.
– user922475
Oct 11 '12 at 16:30
|
show 2 more comments
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12843501%2ferror-returns-void-a-return-keyword-must-not-be-followed-by-an-object-expressi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you mean: return lstNumbers? i have tried that before stll show the squiggle on return.
– Zayn
Oct 11 '12 at 15:55
Unless you are programming in Visual Studio 2003 and C# 1, you should not be using an ArrayList. Use List<T> from System.Collections.Generic
– Anthony Pegram
Oct 11 '12 at 15:57
I would like to add that private void QuestionAnswer_Load(object sender, EventArgs e) is the method under which it falls. I have even tried changing void to string so i could return with a To String() but it still doesn't work
– Zayn
Oct 11 '12 at 16:02
Its on Visual studio 2012 @ Anthony
– Zayn
Oct 11 '12 at 16:04
It's been stated already that by using 'void' you are in essence saying that your function will return nothing. You need to specify the exact type of the object you intend to return. (Sorry my previous comment was c++ ... so I deleted it).
– user922475
Oct 11 '12 at 16:06