- 浏览: 28234 次
最新评论
文章列表
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" conte ...
<head>
<title>1234</title>
<style>
#container{
width:1000px;
background:gray;
}
#header{
height:150px;
background:yellow;
}
#footer{
height:150px;
background:blue;
}
#main{
height:600px;
background:black;
}
# ...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="PHPEclipse 1.2.0" />
<title>title</ ...
<?php
$s= <<<Eof
121234qwer111t<><>>>\g\v\t\t<<a></a>ll1111ll
Eof;//定界符,这个Eof必须在行首
echo $s;
?>
在AndroidManifast注册activity,欲想运行一个Activity,得先注册
<activity
android:name=".FirstActivity"
android:label="This is my first Activity" //标题栏
>
<intent-filter >
//让FirstActivity,作为主Activity
<action andro ...
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/add_item"
android:title="add"
/>
<item
android:id= ...
// 操作类中的属性
public static void main(String[] args) throws Exception {
Class<?> c1 = null;
try {
c1 = Class.forName("fanshe.Person");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Object newInstance = c1.newInstance();
Field nameField = null;
...
// 取得一个类的全部方法定义
public static void main(String[] args) {
Class<?> class1 = null;
try {
class1 = Class.forName("fanshe.Person");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Method[] methods = class1.getMethods();// ...
// 反射
// 实例化对象 -> getClass方法 -> 得到完整的包.类名称
public static void main(String[] args) {
X x = new X();// 所有对象都是Class类的实例
// 实例化Class类对象
Class<?> class1 = null;
Class<?> class2 = null;
Class<?> class3 = null;
try {
//通过静态方法,实例化Class类对象
class1 ...
public class T2 {
// 使用enum声明的枚举类型,就相当于定义一个类;此类默认继承类Enum
public static void main(String[] args) {
//Color.values(); 返回所有枚举的对象
for (Color1 c : Color1.values()) {
System.out.println(c.ordinal() + " " + c.getName());
}
}
}
enum Color1 {
RED("红色"), BLU ...
//foreach,在类集的应用
public static void main(String[] args) {
List<Integer> arrayList = new ArrayList<Integer>();
arrayList.add(1);
arrayList.add(2);
arrayList.add(3);
// for(类 对象 : 集合)
for (Integer integer : arrayList) {
System.out.println(integer);
}
}
// Collections,工具类
public static void main(String[] args) {
List<Integer> list = new ArrayList<Integer>();
// Collections,为List增加内容
Collections.addAll(list, 10, 1, 2, 34, 5, 6, 653, 211, 23);
Iterator<Integer> iterator = list.iterator();
while (iterator.hasNex ...
//在一个循环,同时输出key和value
public static void main(String[] args) {
Map<String, String> hashMap = new HashMap<String, String>();
hashMap.put("a", "1234");
hashMap.put("m", "oi");
hashMap.put("p", "看");
hashMap.put(& ...
// 字典,Map接口
public static void main(String[] args) {
Map<String, String> hashMap = new HashMap<String, String>();
hashMap.put("1", "Brock");
hashMap.put("2", "chris");
hashMap.put("3", "ood");// 增加元素
String s ...
//保存属性,到文件
public static void main(String[] args) {
Properties properties = new Properties();
properties.setProperty("a", "Apple");
properties.setProperty("b", "Bitch");
properties.setProperty("c", "CC");// 设置内容
try {
...