-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcatenate.java
More file actions
31 lines (27 loc) · 769 Bytes
/
concatenate.java
File metadata and controls
31 lines (27 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.*;
class concatenate
{
public static void main(String args[])
{
Scanner ob = new Scanner(System.in);
concatenate obj= new concatenate();
System.out.println("enter the first number");
int first = ob.nextInt();
System.out.println("enter the second number");
int second = ob.nextInt();
System.out.println("enter the first string");
String s= ob.next();
System.out.println("enter the second string");
String r= ob.next();
obj.concat(first,second);
obj.concat(s,r);
}
void concat(int f,int s)
{
System.out.println("concatenated numbers is = "+f+s);
}
void concat(String f,String s)
{
System.out.println("concatenated string is = "+f+s);
}
}