Wrox Programmer Forums
|
BOOK: MCSD Certification Toolkit (Exam 70-483): Programming in C#
This is the forum to discuss the Wrox book MCSD Certification Toolkit (Exam 70-483): Programming in C# by Tiberiu Covaci, Rod Stephens, Vincent Varallo, Gerry O'Brien; ISBN: 978-1-118-61209-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: MCSD Certification Toolkit (Exam 70-483): Programming in C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2013, 03:35 PM
Registered User
 
Join Date: Jul 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Incorrect statement in Note on page 83

The note on page 83 states "It is illegal to include a return statement in a method that declares the return type void."

This is not correct. I believe what was intended here was to indicate that you can not return a value but you can include a return statement. The following is valid code.

Code:
using System;

namespace ConsoleApplication1
{
    class Program
    {
        public static void X(int a)
        {
            if (a > 0)
            {
                Console.WriteLine("blah");
                return;   
            }

            Console.WriteLine("Hi");
            return;
        }
        static void Main(string[] args)
        {
            X(1);
        }
    }
}
 
Old December 8th, 2013, 10:07 PM
Registered User
 
Join Date: Dec 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

+1 the statement is misleading.
 
Old December 9th, 2013, 12:25 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

rupe120:
Yes you're right, a void method can use a return statement without any return value.
Thieum22:
Sorry but I don't understand what you mean by "the +1 statement is misleading." Is this on page 83? Or perhaps some other page?

(If it's not related to the original post, then it should probably be a new post so people can figure out what it's about from the title.)

Can you clarify?
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 
Old December 9th, 2013, 12:43 PM
Registered User
 
Join Date: Dec 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

@Rod Stephens :

Was just agreeing with the original post.

+1 is a way to tell you agree with someone in internet forums.

http://www.urbandictionary.com/define.php?term=%2B1
 
Old December 9th, 2013, 01:35 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Thumbs up

Sorry, I get it now. (It's gonna be one of those Mondays!)

FWIW, I agree, too.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
thank you note masterlayouts BOOK: Beginning Database Design Solutions ISBN: 978-0-470-38549-4 1 July 22nd, 2012 11:19 AM
[Page 83] Checking whether the character is Digit/Letter/Whitespace javaKid1337 BOOK: Ivor Horton's Beginning Java, Java 7 Edition 0 May 1st, 2012 05:39 AM
Working with Strings Function Try It Out page : 83 nawar youssef BOOK: Beginning PHP 5.3 1 September 11th, 2011 09:29 AM
BIND attribute (page 83) Stephan_GER BOOK: Professional ASP.NET MVC 2 2 September 7th, 2010 12:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.