LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Very easy java question (https://www.linuxquestions.org/questions/programming-9/very-easy-java-question-877246/)

puppymagic 04-26-2011 04:31 PM

Very easy java question
 
I often see this

aaa.bbb();

The above is not hard. aaa might be an instance of a certain class, and bbb() is the method included on the class.

myObject.mymethod(); <= this is not hard to understand.

But what about something like this?

aaa.ccc.bbb();?

what is the ccc in that? It would be neither the name of the instance nor the name of the method.

Here is an example.

R.layout.main

What is layout and what is main in that situation?

and another example that comes to my mind is

System.out.println();

what is out in the above example?

Thanks a lot, world-class experts @ Linux Questions!!

Tinkster 04-26-2011 05:26 PM

http://en.wikipedia.org/wiki/Namespa...cience%29#Java



Cheers,
Tink

paulsm4 04-26-2011 07:26 PM

Hi -

There are actually *several* different possibilities:

EXAMPLE: aaa.bbb.ccc()

* member function "ccc()" of object "bbb" in namespace "aaa"

... or ...

* member function "ccc()" of object "bbb", which is itself a member of object "aaa"

There's also the idiom:

* aaa.bbb().ccc()
Quote:

EXAMPLE:
http://download.oracle.com/javase/6/...ang/Class.html

Class.forName("Foo", true, this.getClass().getClassLoader())

MTK358 04-27-2011 07:58 AM

Quote:

Originally Posted by puppymagic (Post 4337267)
aaa.ccc.bbb();?

Class aaa has a member named ccc (which is an instance of a class), which has a method called bbb.

AnanthaP 04-27-2011 09:42 AM

Class.object.subroutine()

Subroutine may be a method.


All times are GMT -5. The time now is 08:41 PM.