repl.it
@AlexLovelock/

Function practice 1

Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import java.util.Scanner;
class Main {
  public static void greeting(String name) {
    System.out.println("hello " + name);
  }
  
  public static void main(String[] args) {
   Scanner input = new Scanner(System.in);  
   
   System.out.println("whats your name");
   String name = input.nextLine();
   
   greeting(name);

    } 
  }