Skip to content

Instantly share code, notes, and snippets.

@mariiaKolokolova
Created May 6, 2020 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariiaKolokolova/8256e367aaa3d544f62f12c6556cd31e to your computer and use it in GitHub Desktop.
Save mariiaKolokolova/8256e367aaa3d544f62f12c6556cd31e to your computer and use it in GitHub Desktop.
package maricka.kolokolova;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
System.out.println("Input string value:");
String str = sc.nextLine();
System.out.println("Input integer value:");
int integer = sc.nextInt();
System.out.println("Input double value:");
double dbl = sc.nextDouble();
System.out.println("Your result: " + concatenate(str, integer, dbl));
sc.close();
}
static String concatenate(String str, int num, double db) {
String rezult = str + (num + db);
return rezult;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment