Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  17 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Paka Small  
View profile  
 More options Feb 5, 11:56 am
Newsgroups: comp.lang.java.programmer
From: Paka Small <paka...@tumia.org>
Date: Sun, 5 Feb 2012 08:56:49 -0800 (PST)
Local: Sun, Feb 5 2012 11:56 am
Subject: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
Hi,

Poll: Is a Java Method an Instance of the Java Class
java.lang.reflect.Method?

Please put YES or NO as the first word in your reply. Add comments
after it if you wish.

I'll make a YES/NO count after some time.

Kind regards, Paka


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lew  
View profile  
 More options Feb 5, 2:38 pm
Newsgroups: comp.lang.java.programmer
From: Lew <lewbl...@gmail.com>
Date: Sun, 5 Feb 2012 11:38:05 -0800 (PST)
Local: Sun, Feb 5 2012 2:38 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

Paka Small wrote:
> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

It's not subject to vote. It's defined by the language. You might as well ask, "Is 'int' a primitive or a reference type?". Your vote will not change reality.

> Please put YES or NO as the first word in your reply. Add comments
> after it if you wish.

> I'll make a YES/NO count after some time.

And what exactly do you hope to accomplish by this exercise? Distinguish who
knows Java from those who don't?

A method is not a class, and a class is not a method. That's reality in Java.
The law of gravity is not subject to repeal by opinion, and neither is this.

Instead of wasting your time and trying to waste ours conducting meaningless
polls, why don't you read the material linked upthread and learn the truth for
yourself?

Learn the truth and it will set you free, or at least keep you from making
errors like claiming that methods and classes are the same in Java.

--
Lew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paka Small  
View profile  
 More options Feb 5, 5:53 pm
Newsgroups: comp.lang.java.programmer
From: Paka Small <paka...@tumia.org>
Date: Sun, 5 Feb 2012 14:53:47 -0800 (PST)
Local: Sun, Feb 5 2012 5:53 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On 5 feb, 20:38, Lew <lewbl...@gmail.com> wrote:

Dear Lew,

You write "> Learn the truth and it will set you free, or at least
keep you from making

> errors like claiming that methods and classes are the same in Java.". Nowhere and never I have stated that methods are classes. Again please have the decency not to put words in my mouth! Or show me where I have claimed that methods and classes are the same.

What I have put forward here in this poll and in an earlier discussion
is that a Java Method is an Instance of the Java Class
java.lang.reflect.Method. I'm glad you finally admit to this truth.

Kind regards, Paka


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lew  
View profile  
 More options Feb 6, 4:55 am
Newsgroups: comp.lang.java.programmer
From: Lew <lewbl...@gmail.com>
Date: Mon, 6 Feb 2012 01:55:00 -0800 (PST)
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

Paka Small wrote:
> Nowhere and never I have stated that methods are classes. Again please have
> the decency not to put words in my mouth! Or show me where I have claimed
> that methods and classes are the same.

I answered that in the other thread, quoting you precisely saying exactly that.

> What I have put forward here in this poll and in an earlier discussion
> is that a Java Method is an Instance of the Java Class
> java.lang.reflect.Method. I'm glad you finally admit to this truth.

A Java method is not an instance of the Java class java.lang.reflect.Method. A
method is not an instance of anything in Java. You saying that I "finally admit
to this truth" doesn't change what I am saying, nor the truth.

You are mistaken. I have pointed you to the correct documentation.

Quite frankly I am mystified by your obstinance. The truth is the truth. Why is
it unpleasant to learn the truth? You seem to have so much invested in
promulgating this canard that a method is an instance of a class, or that it is
a class, or that a method is an instance of 'Method'. None of those statements
are true.

--
Lew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paka Small  
View profile  
 More options Feb 6, 2:57 pm
Newsgroups: comp.lang.java.programmer
From: Paka Small <paka...@tumia.org>
Date: Mon, 6 Feb 2012 11:57:35 -0800 (PST)
Local: Mon, Feb 6 2012 2:57 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On 6 feb, 10:55, Lew <lewbl...@gmail.com> wrote:

Hi,

Example code proving beyond any doubt that a method is an instance of
the class java.lang.reflect.Method in Java:

  public final void setValue(BaseObject baseObject, Object value) {
    java.lang.reflect.Method setMethod = null;
    try {
      setMethod =
baseObjectClass.getJavaClass().getMethod(this.getSetMethodName(), new
Class[]{this.type});
      } catch (NoSuchMethodException ex) {

Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
      } catch (SecurityException ex) {

Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
      }
    try {
      setMethod.invoke(baseObject, new Object[]{value});
    } catch (IllegalAccessException ex) {

Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
    } catch (IllegalArgumentException ex) {

Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
    } catch (InvocationTargetException ex) {

Logger.getLogger(BaseObjectAttribute.class.getName()).log(Level.SEVERE,
null, ex);
    }
  }

Kind regards, Paka


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lew  
View profile  
 More options Feb 6, 8:14 pm
Newsgroups: comp.lang.java.programmer
From: Lew <lewbl...@gmail.com>
Date: Mon, 6 Feb 2012 17:14:46 -0800 (PST)
Local: Mon, Feb 6 2012 8:14 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

Paka Small wrote:
> Example code proving beyond any doubt that a method is an instance of
> the class java.lang.reflect.Method in Java:

Posting the same code twice does not make your point any less false.

--
Lew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joshua Cranmer  
View profile  
 More options Feb 7, 12:54 am
Newsgroups: comp.lang.java.programmer
From: Joshua Cranmer <Pidgeo...@verizon.invalid>
Date: Mon, 06 Feb 2012 23:54:04 -0600
Local: Tues, Feb 7 2012 12:54 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On 2/5/2012 10:56 AM, Paka Small wrote:

> Hi,

> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

... Hell no, even if you stretch the definitions greatly.

The latter class is an object which uses internal APIs to the VM to
collect metadata needed for methods; it is not an instance of any
internal object itself. It may be the case that it is uniqued to some
internal construct representing the executable handle for a method
(IIRC, there are four or five these of though, at least in OpenJDK).

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Feb 7, 12:58 am
Newsgroups: comp.lang.java.programmer
From: Patricia Shanahan <p...@acm.org>
Date: Mon, 06 Feb 2012 21:58:50 -0800
Local: Tues, Feb 7 2012 12:58 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On 2/5/2012 8:56 AM, Paka Small wrote:

> Hi,

> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

> Please put YES or NO as the first word in your reply. Add comments
> after it if you wish.

> I'll make a YES/NO count after some time.

> Kind regards, Paka

NO

Though I think a little JLS reading would be better than a poll.

Historically, JDK 1.0 had methods, but not java.lang.reflect. If methods
were instances of java.lang.reflect.Method they could not have existed
before the class existed.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leif Roar Moldskred  
View profile  
 More options Feb 7, 2:09 am
Newsgroups: comp.lang.java.programmer
From: Leif Roar Moldskred <le...@dimnakorr.com>
Date: Tue, 07 Feb 2012 01:09:45 -0600
Local: Tues, Feb 7 2012 2:09 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

Paka Small <paka...@tumia.org> wrote:
> Hi,

> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

Is a file on the filesystem an instance of java.lang.File?

Is a database an instance of javax.sql.DataSource?

Are you an instance of some.corporation.datamodel.Person?

You're confusing a reference to the thing with the thing
itself.

--
Leif Roar Moldskred


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Cager  
View profile  
 More options Feb 7, 5:41 am
Newsgroups: comp.lang.java.programmer
From: Paul Cager <paul.ca...@googlemail.com>
Date: Tue, 7 Feb 2012 02:41:03 -0800 (PST)
Local: Tues, Feb 7 2012 5:41 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On Feb 7, 5:58 am, Patricia Shanahan <p...@acm.org> wrote:

> On 2/5/2012 8:56 AM, Paka Small wrote:
...
> > Poll: Is a Java Method an Instance of the Java Class
> > java.lang.reflect.Method?

> Historically, JDK 1.0 had methods, but not java.lang.reflect. If methods
> were instances of java.lang.reflect.Method they could not have existed
> before the class existed.

Much as I agree with your conclusion, I'm not sure about your logic
there. You could say that JDK  1.0 had java.util.Hashtable but not
java.util.Map; therefore Hashtable cannot implement Map.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Cager  
View profile  
 More options Feb 7, 6:01 am
Newsgroups: comp.lang.java.programmer
From: Paul Cager <paul.ca...@googlemail.com>
Date: Tue, 7 Feb 2012 03:01:19 -0800 (PST)
Local: Tues, Feb 7 2012 6:01 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
No.

On Feb 5, 4:56 pm, Paka Small <paka...@tumia.org> wrote:

> Hi,

> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

> Please put YES or NO as the first word in your reply. Add comments
> after it if you wish.

> I'll make a YES/NO count after some time.

No, Java methods are not instances of a class.

java.lang.reflect.Method's Javadoc defines j.l.r.Method as:

  "A Method provides information about, and access to, a single method
on a class or interface."

If your question was rephrased as "is it useful to think of Java
methods as instances of j.l.r.Method?" I'd still have to say "no". It
just muddies the terminology without any noticeable benefits. It's a
bit like saying "I like to regard java.util.Dates as Strings with a
few additional methods".


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mayeul  
View profile  
 More options Feb 7, 6:13 am
Newsgroups: comp.lang.java.programmer
From: Mayeul <mayeul.marg...@free.fr>
Date: Tue, 07 Feb 2012 12:13:45 +0100
Local: Tues, Feb 7 2012 6:13 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On 05/02/2012 17:56, Paka Small wrote:

> Hi,

> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

> Please put YES or NO as the first word in your reply. Add comments
> after it if you wish.

> I'll make a YES/NO count after some time.

NO.

Rationale: I suppose by 'Java Method' the question meant 'Java method',
without needless capitalization of the word 'method'. And a 'Java
method' seems clearly to mean a 'method of a class in Java'.

A method is not an instance of any class, in particular it is not an
instance of the class java.lang.reflect.Method. Hence the answer no.

Rationale for my supposition: If 'Java Method' did not mean 'Java
method', the only reasonable thing it could mean instead, would be, 'an
instance of the Method class in Java' and the Method class is usually
assumed to be java.lang.reflect.Method.
In that case, the question would be asking a tautolgy, which bears less
point than anything else.

--
Mayeul


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patricia Shanahan  
View profile  
 More options Feb 7, 12:35 pm
Newsgroups: comp.lang.java.programmer
From: Patricia Shanahan <p...@acm.org>
Date: Tue, 07 Feb 2012 09:35:35 -0800
Local: Tues, Feb 7 2012 12:35 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

Paul Cager wrote:
> On Feb 7, 5:58 am, Patricia Shanahan <p...@acm.org> wrote:
>> On 2/5/2012 8:56 AM, Paka Small wrote:
> ...
>>> Poll: Is a Java Method an Instance of the Java Class
>>> java.lang.reflect.Method?
>> Historically, JDK 1.0 had methods, but not java.lang.reflect. If methods
>> were instances of java.lang.reflect.Method they could not have existed
>> before the class existed.

> Much as I agree with your conclusion, I'm not sure about your logic
> there. You could say that JDK  1.0 had java.util.Hashtable but not
> java.util.Map; therefore Hashtable cannot implement Map.

I think an object existing before its class is a lot more problematic
than a class existing before an interface it implements.

Patricia


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Pitts  
View profile  
 More options Feb 7, 12:52 pm
Newsgroups: comp.lang.java.programmer
From: Daniel Pitts <newsgroup.nos...@virtualinfinity.net>
Date: Tue, 07 Feb 2012 09:52:10 -0800
Local: Tues, Feb 7 2012 12:52 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
On 2/6/12 11:57 AM, Paka Small wrote:

java.lang.reflect.Method instances are abstracts around the details of a
method and ways of invoking Java methods. They are not themselves
methods.  Methods are a "signature" + bytecode. Methods are not classes,
they are part of classes.  Methods are not objects, they act on objects.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lew  
View profile  
 More options Feb 7, 1:59 pm
Newsgroups: comp.lang.java.programmer
From: Lew <lewbl...@gmail.com>
Date: Tue, 7 Feb 2012 10:59:38 -0800 (PST)
Local: Tues, Feb 7 2012 1:59 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

On Tuesday, February 7, 2012 2:41:03 AM UTC-8, Paul Cager wrote:
> On Feb 7, 5:58 am, Patricia Shanahan
>  wrote:
> > On 2/5/2012 8:56 AM, Paka Small wrote:
> ...
> > > Poll: Is a Java Method an Instance of the Java Class
> > > java.lang.reflect.Method?

> > Historically, JDK 1.0 had methods, but not java.lang.reflect. If methods
> > were instances of java.lang.reflect.Method they could not have existed
> > before the class existed.

> Much as I agree with your conclusion, I'm not sure about your logic
> there. You could say that JDK  1.0 had java.util.Hashtable but not
> java.util.Map; therefore Hashtable cannot implement Map.

That is a red herring. Patricia said that the existence of methods as objects
would have had to predate the existence of 'Method', not that they couldn't
have been retrofitted (although really they can't be - another difference from
your analogy). Patricia's logic is flawless.

--
Lew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lew  
View profile  
 More options Feb 7, 2:04 pm
Newsgroups: comp.lang.java.programmer
From: Lew <lewbl...@gmail.com>
Date: Tue, 7 Feb 2012 11:04:46 -0800 (PST)
Local: Tues, Feb 7 2012 2:04 pm
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

Stefan Ram wrote:
> Paka Small writes:
>> Poll: Is a Java Method an Instance of the Java Class
>> java.lang.reflect.Method?
>   It's »method«, »instance«, and »class«;
>   not »Method«, »Instance«, and »Class«.

Right on!

Case counts, Paka. Carelessness is harmful.

>   The JLS3 says:

>       »A method declares executable code that can be invoked,
>       passing a fixed number of values as arguments.«, 8.4.

>   (So, and when a method already declares something,
>   what then is a »method declaration«? The declaration
>   of a declaration?)

Good point, Stefan. I have to conclude that "declares" in the cited passage
means the usual English meaning, not the specific Java meaning. They should
have said, "A method comprises executable code that ..."

>   JDK 1.0 and 1.1 have no reflection, so when then answer
>   would be »yes«, then they would have no methods.

But really, Paka, taking a poll about what is real is stupid and pointless.
Opinion doesn't alter reality. However, the correct, factual, real answers that
you get from everyone agree with each other. What does that tell you, Paka?

It's time to start arguing that there's no train bearing down on you and to
step off the tracks, Paka.

--
Lew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wanja Gayk  
View profile  
 More options Feb 8, 10:05 am
Newsgroups: comp.lang.java.programmer
From: Wanja Gayk <brixoma...@yahoo.com>
Date: Wed, 8 Feb 2012 16:05:27 +0100
Local: Wed, Feb 8 2012 10:05 am
Subject: Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
In article <7747b7da-e579-4514-bdff-a9eb8842cc51
@l16g2000vbl.googlegroups.com>, paka...@tumia.org says...

> Hi,

> Poll: Is a Java Method an Instance of the Java Class
> java.lang.reflect.Method?

> Please put YES or NO as the first word in your reply. Add comments
> after it if you wish.

NO.
Instances of java.lang.reflect.Method are objects to provide additional
access to Java methods and they have not been part of the Java ecosystem
until the reflection API has been introduced.

The Java virtual machine does not instantiate java.lang.reflect.Method
objects either, if a method call is required, not even the Java bytecode
expresses something like that.

I don't see why you put up a poll to answer this question, it's not
disputed and it's not possible to argue about it.

Kind regards,
Wanja

--
..Alesi's problem was that the back of the car was jumping up and down
dangerously - and I can assure you from having been teammate to
Jean Alesi and knowing what kind of cars that he can pull up with,
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to n...@netfront.net ---


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »