✏️ Explanatory Question
[Packages]
Question:
Given the following code snippet:
package mine;
public class Greetings
{
public static void greet(String name)
{
System.out.println("Hello " + name +
", welcome to the world of programming");
}
}
import java.util.*;
import mine.*;
public class Trial
{
public static void main()
{
Scanner sc = new Scanner(System.in);
System.out.println("Give your name");
String n = sc.next();
Greetings.greet(n);
}
}
(a) Predict the output for n = "Abhay".
(b) Explain the difference between:
import java.util.*;
and
import mine.*;