8850702的博客
8850702 · 共 73 篇文章
HTML综合练习
<!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" content="text/html;charset=UTF-8"> <title>t3</title> <link rel="stylesheet" href…
2016-08-14 22:18 · 评论(0)
css布局1
<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; } #left{ height:600px; width:600px; background:pink; float:left; } #right{ height:600px; width…
2016-08-05 00:20 · 评论(0)
css画三角形
<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</title> <style> #triangle{ width:0px; height:0px; border-top:50px solid white; border-right:50px solid w…
2016-08-05 00:16 · 评论(0)
Php的定界符
<?php $s= <<<Eof 121234qwer111t<><>>>\g\v\t\t<<a></a>ll1111ll Eof;//定界符,这个Eof必须在行首 echo $s; ?>
2016-03-27 01:24 · 评论(0)
安卓.Activity
在AndroidManifast注册activity,欲想运行一个Activity,得先注册 <activity android:name=".FirstActivity" android:label="This is my first Activity" //标题栏 > <intent-filter > //让FirstActivity,作为主Activity <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </in…
2016-03-15 22:15 · 评论(0)
给Activity添加菜单
<?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="@+id/removee_item" android:title="remove" /> </menu> //复写 @Override public boolean onCreateOptionsMenu(Menu menu) { //给…
2016-03-14 13:21 · 评论(0)
Java反射.操作属性和数组
// 操作类中的属性 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; Field ageField = null; nameField = c1.getDec…
2016-03-13 22:30 · 评论(0)
Java.反射.调用方法
// 取得一个类的全部方法定义 public static void main(String[] args) { Class<?> class1 = null; try { class1 = Class.forName("fanshe.Person"); } catch (ClassNotFoundException e) { e.printStackTrace(); } Method[] methods = class1.getMethods();// 得到类的全部方法 for (int i = 0; i < methods.length; i++) { // 得到方法名 String m…
2016-03-13 21:07 · 评论(0)
Java反射
// 反射 // 实例化对象 -> 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 = Class.forName("fanshe.X"); } catch (ClassNotFoundException …
2016-03-13 21:01 · 评论(0)
Java.枚举
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("红色"), BLUE("蓝色"), GREEN("绿色");//声明枚举时,必须调用这个构造方法 private Str…
2016-03-13 12:04 · 评论(0)
java.foreach.在类集的应用
//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); } }
2016-03-12 18:22 · 评论(0)
Java.Collections,工具类
// 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.hasNext()) { Integer integer = iterator.next(…
2016-03-12 18:20 · 评论(0)
Java.在一个循环,同时输出Map的key和value
//在一个循环,同时输出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("d", "fuck"); hashMap.put("e", "2"); hashMap.put("v", "-_-");//以上,添加元素 //将Map接口,变为Set接口 Se…
2016-03-12 18:20 · 评论(0)
Java字典,Map接口
// 字典,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 string = hashMap.get("3");// 取出元素 System.out.println(string); //判断字典里面,有没有这个key System.out.p…
2016-03-12 18:17 · 评论(0)
保存属性.读取属性.到文件.到XML
//保存属性,到文件 public static void main(String[] args) { Properties properties = new Properties(); properties.setProperty("a", "Apple"); properties.setProperty("b", "Bitch"); properties.setProperty("c", "CC");// 设置内容 try { // 保存属性到文件。“Info”是文件注释内容 properties.store(new FileOutputStream(new File("d:") + F…
2016-03-12 18:11 · 评论(0)