Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29375

Re: Help understanding methods

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Scott Dunning <scottwd01@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Help understanding methods
Date Sun, 27 Jul 2014 18:19:53 -0700
Organization A noiseless patient Spider
Lines 21
Message-ID <lr48at$c53$1@dont-email.me> (permalink)
References <lr46d1$ub3$1@dont-email.me> <lr483r$bpk$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Mon, 28 Jul 2014 01:17:17 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="11828741c91d0da908948c6ecdf164c7"; logging-data="12451"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uZzJHIgQlmK4nbSG0JMRho0bKDlR5cFQ="
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <lr483r$bpk$1@dont-email.me>
Cancel-Lock sha1:CcdNU3TCfU8+wiNeMeSoBeMz9J4=
Xref csiph.com comp.lang.java.programmer:29375

Show key headers only | View raw


> The return statement ends the code path so the System.out line can never
> be reached.
>
> The second error is because there is not a return statement as the last
> thing in the method.
>
> To fix it: move the print statement to the main method
>
> That should do it.
>
Awesome, thanks Knute!

I have a couple other questions about this if you guys don't mind.

What I'm a little unclear about is when calling the function why I need 
maxValue? I kinda just added that because of other methods I've seen. 
Why isn't (like python) I'm just calling the method like this...
max3(a, b, c);?

Why do I need a new (..variable I guess)?

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Help understanding methods Scott Dunning <scottwd01@gmail.com> - 2014-07-27 17:46 -0700
  Re: Help understanding methods Knute Johnson <eternal@knutejohnson.com> - 2014-07-27 18:13 -0700
    Re: Help understanding methods Scott Dunning <scottwd01@gmail.com> - 2014-07-27 18:19 -0700
      Re: Help understanding methods Knute Johnson <eternal@knutejohnson.com> - 2014-07-27 18:49 -0700
        Re: Help understanding methods Knute Johnson <eternal@knutejohnson.com> - 2014-07-27 21:36 -0700
  Re: Help understanding methods Martin Gregorie <martin@address-in-sig.invalid> - 2014-07-28 01:18 +0000
  Re: Help understanding methods Scott Dunning <scottwd01@gmail.com> - 2014-07-27 18:56 -0700
    Re: Help understanding methods "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-07-28 12:07 +0100
      Re: Help understanding methods "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-07-28 12:44 +0100
  Re: Help understanding methods Roedy Green <see_website@mindprod.com.invalid> - 2014-07-28 07:20 -0700
  Re: Help understanding methods Josip Almasi <joe@vrspace.org> - 2014-07-28 21:29 +0200

csiph-web