I want to know how to mix the 2 languages together to make 1. What I mean is:
Assume you have a java program that finds the sum of 2 numbers:
public static void main(String[] args){
int results = findAvg(10,20);
public int findAvg(int x, int y){
return (x+y)/2;
}
}
Assume you have another html program below:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Average of 2 numbers x and y:</h1>
<p>Ans: results</p> //where x, y and results are from the java program above
My question is: If I want to create a program that runs and displays the result in a browser, how will I go about it. Also, will the file be a .java or .html file. Any help is deeply appreciated
servletandJSP...