Computer Science, asked by rakesh449, 2 months ago

write two program on string using Java language​

Answers

Answered by bhavyasaxena0511
1

Answer:

what's the question explain thoroughly

I am telling what I have understood

that's write 2 programs in which you have to use String..

1. Scanner class

Explanation:

import java.util.*;

class ABC

{

public static void main(String args[])

{

Scanner sc=new Scanner (System.in);

System.out.println("NAME OF FIRST FRIEND);

String a =sc.nextLine();

System.out.println("Name Of Second Friend ");

String b =sc.nextLine();

System.out.println(a+" and "+b+" are good friends ");

}

}

Output Will be

(you can Enter any name you want to)

I am entering jack and Jill)

Enter Name of first friend

JACK

Enter Name oF Second Friend

Jill

Jack and jill are good Friends

THIS WILL BE THE OUT PUT

Similar questions