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


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

Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.

From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
Newsgroups comp.lang.java.programmer
Subject Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO.
References <7747b7da-e579-4514-bdff-a9eb8842cc51@l16g2000vbl.googlegroups.com> <23822119.1928.1328470685151.JavaMail.geo-discussion-forums@prak33> <15201988-a174-4359-9f40-3fb04b6178bd@18g2000yqe.googlegroups.com> <5572576.2320.1328522100332.JavaMail.geo-discussion-forums@prie27> <6cef9e71-ae9d-4f90-aa90-06467cdf896f@b18g2000vbz.googlegroups.com>
Message-ID <fxdYq.20407$Sh7.18854@newsfe15.iad> (permalink)
Date 2012-02-07 09:52 -0800

Show all headers | View raw


On 2/6/12 11:57 AM, Paka Small wrote:
> On 6 feb, 10:55, Lew<lewbl...@gmail.com>  wrote:
>> 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
>
> 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

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.

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


Thread

Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Paka Small <paka-en@tumia.org> - 2012-02-05 08:56 -0800
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Lew <lewbloch@gmail.com> - 2012-02-05 11:38 -0800
    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-en@tumia.org> - 2012-02-05 14:53 -0800
      Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Lew <lewbloch@gmail.com> - 2012-02-06 01:55 -0800
        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-en@tumia.org> - 2012-02-06 11:57 -0800
          Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Lew <lewbloch@gmail.com> - 2012-02-06 17:14 -0800
          Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-07 09:52 -0800
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-02-06 23:54 -0600
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Patricia Shanahan <pats@acm.org> - 2012-02-06 21:58 -0800
    Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Paul Cager <paul.cager@googlemail.com> - 2012-02-07 02:41 -0800
      Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Patricia Shanahan <pats@acm.org> - 2012-02-07 09:35 -0800
      Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Lew <lewbloch@gmail.com> - 2012-02-07 10:59 -0800
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-02-07 01:09 -0600
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Paul Cager <paul.cager@googlemail.com> - 2012-02-07 03:01 -0800
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Mayeul <mayeul.marguet@free.fr> - 2012-02-07 12:13 +0100
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Lew <lewbloch@gmail.com> - 2012-02-07 11:04 -0800
  Re: Poll: Is a Java Method an Instance of the Java Class java.lang.reflect.Method? Please reply with YES or NO. Wanja Gayk <brixomatic@yahoo.com> - 2012-02-08 16:05 +0100

csiph-web