java - Passing String from one class to another - Stack Overflow

Опубликовано: 20 Февраль 2026
на канале: ResponseXAI
No
0

There are two ways:


create an instance of your printer class and evoke the method on the printer object:

public class MyPrinter
{
public void printString( String string )
{
System.out.print

#printstringwithstaticmethod( #create #myprinter #ways: #this
https://stackoverflow.com/questions/3...

https://stackoverflow.com/questions/3...