JavaScript
=======================================================================
<html><head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("Hello, 賀信華.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>
=======================================================================
參考資料:http://taiwantc.com/js/js_tut_a1.htm
=======================================================================
..............................................................................................................................................
=======================================================================
JAVA
=======================================================================
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}
=======================================================================
..............................................................................................................................................
=======================================================================
運用命令提示字元顯示IP
import java.net.*;
public class TestInet1 {
public static void main(String argv[])
{
try {
InetAddress myip = InetAddress.getLocalHost();
System.out.println(myip.getHostName());
System.out.println(myip.getHostAddress());
} catch (UnknownHostException e) {
System.out.println("Error: unable to resolve localhost");
}
}
}
=======================================================================
..............................................................................................................................................
=======================================================================
<html>
<head>
<title> The First Example: Hello, World </title>
</head>
<body>
<h2> This line is HTML </h2>
<script language="JavaScript">
<!--
document.write("Hello, 吳祐豪.This sentence is written using JavaScript.");
// Text on the right of 2 slashes is comment
/* This is comment
that occur more than 1 line
*/
//-->
</script>
<noscript>
Sorry, but your browser doesn't run JavaScript.
</noscript>
<h2> This line is HTML </h2>
</body>
</html>
=======================================================================