fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static void sendMessage() {
  11. System.out.println("Hello, this is sendMessage function");
  12. }
  13. static void sendMessage(String text) {
  14. System.out.println(text);
  15. }
  16.  
  17. static void sendMessage(String to, String text) {
  18. System.out.println(to + ", " + text);
  19. }
  20.  
  21. public static void main (String[] args) throws java.lang.Exception
  22. {
  23. sendMessage();
  24. System.out.println("Hi. I am the main () function");
  25. sendMessage();
  26. sendMessage("مرحبا ");
  27. sendMessage("Mohammed", "This is my first lab"); }
  28. }
Success #stdin #stdout 0.12s 57684KB
stdin
Standard input is empty
stdout
Hello, this is sendMessage function
Hi. I am the main () function
Hello, this is sendMessage function
مرحبا 
Mohammed, This is my first lab