import javax.swing.JOptionPane;
public class Test1 {
public static void main (String[] args) {
// Method 1
Test3 method1 = new Test3(); // is this the method to call Test3()?
JOptionPane.showMessage (null, method1
// Method 2
JOptionPane.showMessageDialog (null, Test3());
// Method 3
JOptionPane.showMessageDialog (null, Test3.toString());
}
}
class Test2 {
public String Test3(String Test4) {
if(...) {
x += x.toString();
}
return Test4;
}
public String toString() {
return y;
}
}
If the code looks like this, how can I call Test4 onto main?
I wrote 3 methods I've tried on main method but none of them work... :(