Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Overloading methods question Date: Fri, 26 Oct 2018 20:58:44 -0400 Organization: Aioe.org NNTP Server Lines: 42 Message-ID: References: <1b2bqd7oqzez6$.sfpve8lwmic2.dlg@40tude.net> <75ad8b55-3def-4ec1-b46b-65ecd971d0fe@googlegroups.com> NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: csiph.com comp.lang.java.programmer:38664 On 10/26/2018 3:33 PM, Martin Gregorie wrote: > I haven't (so far) used Enums and it wasn't obvious from the tutorial > stuff that you can put a public Enum inside a class - rather the opposite > in fact, since at one point it said that an enum declaration was at a > similar language level to a class declaration, It is. > which is why I thought it > could not be declared insire a class definition. You can put a class declaration inside a class. > I'll > use Enums that way in future: my main background is Assembler/COBOL/C in > that order, so of course I instantly saw the equivalence between > > #define SHORT 1 or its assembler equivalent > > and > > public static final int ONE = 1; I will say that: C Java #define X 1 No equivalent #define Y 2 #define Z 3 const int X = 1; public static final int X = 1; const int Y = 2; public static final int Y = 2; const int Z = 3; public static final int Z = 3; enum XYZ { X, Y, Z }; public enum XYZ { X, Y, Z } Assuming ANSI C and Java >= 1.5. Arne