Java学习
数据类型
-
强类型语言
- 要求变量的使用要严格符合规定,所有变量都必须先定义后才能使用
-
弱类型语言
-
Java的数据类型分为两大类
-
基本类型(primitive type)
- 整数类型int、long
- 浮点类型double
- 字符串类型char
- boolean布尔类型true和false
-
引用类型(reference type)
- 类
- 接口
- 数组
public class HelloWorld { public static void main(String[] args){ //八大基础数据类型 //整数 int num1 = 1000;//最常用 byte num2 = 20; short num3 = 30; long num4 = 30L;//long类型要在数字后面加上L //小数:浮点数 float num5 = 50.1F;//float类型要在数字后加上F double num6 = 3.1415926535; //字符类型 char name = "程";//字符只能是一个字或字母 //字符串,String不是关键字,是类 //布尔值 boolean flag = true; //boolean flag = false; } }
WEB实验
练习01
<html> <head> <title>表格书本应用案例</title> </head> <body> <table border=2> <caption>新书架</caption> <tr> <td rowspan = 4><img src = "1615184178.png"></td><td align='left'>书名</td><td align='left'>Web程序设计</td> </tr> <tr> <th>作者  </th><th>Robert W.Sebest</th> </tr> <tr> <th>出版社  </th><th>清华大学出版社</th> </tr> <tr> <th>定价  </th><th>¥58.00</th> </tr> <tr> <th>    放入购物车  查看详情    </th> </tr> </table> </body> </html>
-
练习02
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>表单域-列表选择框</title>
</head>
<body>
1.您的年级<br>
<form action="/demo/demo_form.asp">
<select name="年级">
<option value="Gradeone">一年级</option>
<option value="Gradetwo">二年级</option>
<option value="Gradethree">三年级</option>
</select><br>
2.您的专业:<br>
<input type="text" name="您的专业"><br>
3.对于图书馆的阅览环境<br>
<input type="radio" name="manyidu" value="my" checked>满意<br>
<input type="radio" name="manyidu" value="jbmy" checked>基本满意<br>
<input type="radio" name="manyidu" value="bmy" checked>不满意 您的建议<input type="text" name="您的建议"><br>
4.您到图书馆的原因是(可多选):<br>
<input type="checkbox" name="reason" value="a">借阅专业图书
<br>
<input type="checkbox" name="reason" value="b">随便坐坐,翻翻书刊
<input type="checkbox" name="reason" value="c">借阅光盘
<br>
<input type="checkbox" name="reason" value="d">参加图书馆组织的活动
<br>
<input type="checkbox" name="reason" value="e">自习,复习功课
<br>
<input type="checkbox" name="reason" value="f">上网
<br>
<input type="checkbox" name="reason" value="g">检索电子文件
<br>
</form>
</body>
</html>