I'm working on a website for a school project and I'm using html and JavaScript to write it. I wrote a program in java that I'm going to add to the website I'm a little confused about how to implement it into the website, do I just copy paste it into the script of the html or am I missing something
<script type ="text/javascript">
</script>
would I just copy paste the java code in-between there?
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class SearchForWords {
public static void main(String[] args) {
String filename = "input3.c";
try {
Scanner sc = new Scanner(new File(filename));
int lineCount = 1;
while(sc.hasNextLine()) {
String line = sc.nextLine();
if(line.contains("gets")) {
System.out.println("Use fgets() instead of gets() : Found in line " + lineCount);
lineCount++;
}
sc.close();
} catch (FileNotFoundException e) {
System.out.println("File not found");
}
}
}