Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

not all code paths return a value

Posted on 2004-04-08
2
Medium Priority
?
282 Views
Last Modified: 2010-04-15
hi there,

i got that "not all code paths return a value" message when i just created a method like this:

public Category getCategory(string catid)
{
}

since i haven't added any code in it, i don't understand why the complier complained about it.  can anyone give me a hint?

thank you.
0
Comment
Question by:mlcy44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
dfiala13 earned 270 total points
ID: 10785666
Yes,
It expects a variable of the type Category to be returned.  Since you haven't supplied one it gets upset.

You can stub it out this way until you add in your logic...

public Category getCategory(string catid)
{
 return new Category();
}
0
 

Author Comment

by:mlcy44
ID: 10785739
ty, i just realized that.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question