+ 2

How i search a random string in file in java??

String s1 = new String(); s1 = "Nakul" then how i search for string s1 in any file.

28th Apr 2020, 2:44 PM
Nakul Singh
Nakul Singh - avatar
1 Answer
+ 2
Hello Nakul Singh At first: Either s1 = new String("Nakul"); or s1 = "Nakul"; You need to read a file. Here is a good tutorial how to work with files: https://stackabuse.com/reading-and-writing-files-in-java/
29th Apr 2020, 11:02 AM
Denise Roßberg
Denise Roßberg - avatar