Question: How can I make a method to print both integers and strings?
I tried

```
public static void print(String txt){
    System.out.println(txt);
}

```

This way I can only print Strings.

Sorry for my noobish question but I tried searching, but nothing (I'm propably using the wrong keywords)

Thanks for advance.

Answer: 
You can have different signatures with the same method name.

```
public static void print(String txt){
    System.out.println(txt);
}
public static void print(int txt){
    System.out.println(txt);
}

```

You can even "parse" or "clean" arguments to end using the same logic and reduce code.. something like this:

```
public static void print(String txt){
    System.out.println(txt);
}
public static void print(int number){
    print(Integer.toString(number));
}

```
```
class SamplePrint
{

  public static void main(String txt)
  {
    System.out.println(txt);
  }

  public static void main(int txt)
  {
    System.out.println(txt);
  }

  public static void main(String args[])
  {
    // This will automatically calls to print() which has string type arguments
    print("Hello Friend");

    // This will automatically calls to print() which has int type arguments
    print(100);
  }
}

```