Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Sorry if my questions are a little dumb. I'm young and I'm still learning.
I have been asking around and I dont understand the printData method? What does it really do? How is it different from System.out.println? Also what is 'return;'for? As in why do I need it?
Sorry if there are too many questions.
All help is greatly appreciated <3

What I have tried:

I've visited other forums and tried googling but I still dont understand.
Posted
Updated 31-Dec-20 11:40am
Comments
Richard MacCutchan 1-Jan-21 3:46am    
Where did you see the reference to this method?

1 solution

There is no printData method in Java SDK (that I know of), the only way to print content to the logs is using the System.out.

System (Java Platform SE 7 )[^]

Maybe, if you can show the code we can better help. I am thinking this is a member method of a class that you might have defined that "internally" calls the System.out.println() method.

Secondly, the return is a basic control statement that "returns" the control to the caller of this method and passes the value as a result of this method. If called without a value (as in a void method) then it just returns the control and doesn't provide any value.

See this for more on this topic: Returning a Value from a Method (The Java™ Tutorials > Learning the Java Language > Classes and Objects)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900