Hello guys. I have a question. How is: -
System.out.println("Hello, world!");
-
a method? I haven't typed anything like: -
void System.out.println() {
-
blahblahblah
-
}
-
and I never typed:
So how is this a method call? Also do you think that Java C++ etc should be called Object Oriented Programming Languages(oop) or Class Oriented Programming Languages(cop). Thanks :-)
8 1041
Hello guys. I have a question. How is: -
System.out.println("Hello, world!");
-
a method? I haven't typed anything like: -
void System.out.println() {
-
blahblahblah
-
}
-
and I never typed:
So how is this a method call?
println is a method of the "out" object that is a member of the "System" object. It is already defined, you don't have to define it yourself.
Also do you think that Java C++ etc should be called Object Oriented Programming Languages(oop) or Class Oriented Programming Languages(cop). Thanks :-)
Is this a homework question?
Atli 5,058
Expert 4TB
...
Also do you think that Java C++ etc should be called Object Oriented Programming Languages(oop) or Class Oriented Programming Languages(cop). Thanks :-)
What exactly would be the difference between Object Orientated and Class Orientated languages?
Classes are blueprints used to create objects, so in that sense, they would be one and the same.
println is a method of the "out" object that is a member of the "System" object. It is already defined, you don't have to define it yourself.
As what I've learned println is a method of the out object and out object is from the System class.
Rey Sean
As what I've learned println is a method of the out object and out object is from the System class.
Rey Sean
Right, right. out is a static instance of a PrintStream class, and it belongs to the System class. I can't remember if System is instantiated or not.
Anyway, this is all just semantics.
Edit:
And apparently asked and answered in another forum:
Right, right. out is a static instance of a PrintStream class, and it belongs to the System class. I can't remember if System is instantiated or not.
Anyway, this is all just semantics.
Edit:
And apparently asked and answered in another forum:
Yep, It's a Java question in case anyone hasn't noticed.
Yep, It's a Java question in case anyone hasn't noticed.
Yeah, I thought so, but then I remembered J#. So I guess technically its ok for a .NET forum, right?
Yeah, I thought so, but then I remembered J#. So I guess technically its ok for a .NET forum, right?
That's the reason why the thread has not been moved to the Java forum.
However it should be MERGED with the java thread.
Since identical psots really do not belong in TWO places.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Laurent Thery |
last post by:
Given the following example:
============================================
class A {
int method (B a) {
return 1;
}
}
class B extends A {
|
by: mic |
last post by:
Is it possible to control method exectution using similiar mechanism as with
get/setatrribute special methods for attributes? I'd like to have every (or
some of ) method of class instance run...
|
by: sieg1974 |
last post by:
Hi,
I'm a beginner with c++ programming, and came across the following
code.
I have the following hierarchy of classes where both CLASS_A_PARENT and
CLASS_B_PARENT extend MAIN.
MAIN...
|
by: warren |
last post by:
Hi,
How do I call the base class's version of method when there is polymorphism?
also, what if there are multiple levels of inheritance and i want to call
the method that is
several levels...
|
by: Sylvain Ferriol |
last post by:
hello
can you explain why python does not see difference between instance
method and class method, having the same name
example
.... def f(self):
.... print('instance method')...
|
by: David Veeneman |
last post by:
Should a member variable be passed to a private method in the same class as
a method argument, or should the method simply call the member variable?
For years, I have passed member variables to...
|
by: |
last post by:
Is it possible to get the name of the method that the code is currently
executing in so that I can pass it to another method? For example, in void
method1() I will call void method5(). In method5...
|
by: Steve Richter |
last post by:
in a generic class, can I code the class so that I can call a static
method of the generic class T?
In the ConvertFrom method of the generic TypeConvert class I want to
write, I have a call to...
|
by: idoerg |
last post by:
Hi all,
I am running Python 2.5 on Feisty Ubuntu. I came across some code that
is substantially slower when in a method than in a function.
################# START SOURCE #############
# The...
|
by: =?Utf-8?B?QWJoaQ==?= |
last post by:
I am using Reflection to invoke methods dynamically. I have got a special
requirement where I need to pass a value to method by setting the custom
method attribute. As I cannot change the...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |