Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>Is a sub class of an interface also an interface?</p> </blockquote> <p>There is no such thing as a subclass of an interface. You can <code>extend</code> an interface with another interface, or you can <code>implement</code> an interface with a class.</p> <blockquote> <p>Is a class implementing Runnable Interface also an interface?</p> </blockquote> <p>No - it's a class. An interface is defined with <code>interface</code>, not <code>class</code>.</p> <blockquote> <p>Can't methods/functions be called Operations of a class?</p> </blockquote> <p>Sure - method/function/operation - sounds like reasonable synonyms to me. Internally, Java calls them Methods (see <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/reflect/Method.html" rel="nofollow">reflection related javadoc</a>)</p> <blockquote> <p>Are global variables the only attributes of a class or local variables within a function can also be called so?</p> </blockquote> <p>I assume you're referring to class attributes as the objects/primitives owned by a class instance - in your first example, this would be <code>myID</code> in the <code>SomeThread</code> class. Local variables within a method are only accessible within that method (for example, <code>i</code> in your <code>run</code> method in the same class), and are not class attributes.</p> <blockquote> <p>In the 2nd Program the author is sending an object to the Thread constructor. Is it correct?</p> </blockquote> <p>Yes; <code>new SomeThread2(3)</code> returns an instance of <code>SomeThread</code>, which is also an object.</p> <blockquote> <p>Can someone body please draw the UML for the two programs?</p> </blockquote> <p>Not likely. This sounds too much like homework.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload