- 博客(27)
- 收藏
- 关注
转载 Android源 77,78,79,80
77,78.PhoneListeningpublic class MyService extends Service { private final String TAG = "MyService"; private TelephonyManager tm; private MyPhoneStateListener listener; public MySe...
2018-06-22 15:42:41 172
转载 Android源 74,75,76
74.public class APKAdapter extends BaseAdapter { List<AppsInfo> mAppsInfoList = new ArrayList<AppsInfo>(); Context mContext; public APKAdapter(List<AppsInfo> mAppsIn...
2018-06-22 15:38:51 131
转载 Android源 71,72,73
71.网格布局 <Button android:layout_column="3"(设置该控件位于网格一行4列) android:text="/"/> <Button android:text="1"/>(当上一行满时控件被放于下一行并沿水平方向逐个放置) <Button android:text="2"
2018-06-22 15:29:18 137
转载 Android源68,69,70
private class MyAyncTask extends AsyncTask<String, Integer, String>{ //初始化UI @Override protected void onPreExecute() { super.onPreExecute(); ...
2018-06-22 15:15:55 114
转载 Android源 65,66,67
65.public void onParseXML(View view) { String xml = null; AssetManager assetManager = getAssets(); try { InputStream inputStream = assetManager.open("manifast.x...
2018-06-22 15:13:12 108
转载 Android源 62,63,64
62.public class MainActivity extends AppCompatActivity { private List<String> strIDList; private List<Document> docsList; private List<KugouMusicInfo> kugouMusicInfo...
2018-06-22 15:09:50 93
转载 c++ 90,91,92
90#include "stdio.h"long int f(int year,int month){/*f(年,月)=年-1,如月<3;否则,f(年,月)=年*/ if(month<3) return year-1; else return year;}long int g(int month){/*g(月)=月+13,如月<3;否则,g(月)=月+1*/ if(month
2017-06-09 17:28:21 305
转载 技术博客004
C++类静态成员与类静态成员函数 (2011-05-03 15:44:42)转载▼标签: 类静态成员函数 教育分类: 笔试 面试 当将类的某个数据成员声明为static时,该静态数据成员只能被定义一次,而且要被同类的所有对象共享。各个对象都拥有类中每一个普通数据成员的副本,但静态数据成员只有一个实例存
2017-06-09 17:19:57 144
转载 c++ 79,80,81
79#include void main(){ /* sizeof()是保留字,它的作用是求某类型或某变量类型的字节数, */ /* 括号中可以是类型保留字或变量。*/ /*int型在不同的机器,不同的编译器中的字节数不一样,*/ /*一般来说在TC2.0编译器中字节数为2,在VC编译器中字节数为4 */ printf("The bytes of t
2017-06-09 17:15:45 207
转载 c++ 73,74,75
73#include #define N 200#define SCORES 5#define NUMLEN 10struct std_type{ char no[NUMLEN];/*学号*/ char *name;/*名字符串指针*/ int scores[SCORES];/*五门功课的成绩*/};struct std_type students[N];int order
2017-06-09 17:08:11 260
转载 c++ 67,68,69
67#define ERR 5#define OK 6#include int status;double result,sig,scale;int sign(int c)/*处理数的符号函数*/{ if(c=='-')/*若为负号,置负数标记*/ sig=-sig;}int integer(int c)/*转换整数部分,转换一位整数位*/{ result=r
2017-06-09 16:56:20 299
转载 c++ 61,62,63
61main(){ int x,y,z; /* 定义三个int型变量 */ int *xp = &x, /* 定义指针变量xp,并赋值为x的地址,使xp指向x */ *yp = &y, /* 定义指针变量yp,并赋值为y的地址,使yp指向y */ *zp = &z; /* 定义指针变量zp,并赋值为z的地址,使zp指向z */ int t; clrscr();
2017-06-09 16:51:09 341
转载 c++ 55,56,57
55rest(int a[], int n){ int i,low,high,t; for(i=0,low=0,high=n-1;i<=high;) { if(a[i]>0) { /*a[i]与a[high]交换,随之high减1*/ t=a[i]; a[i]=a[high]; a[high]=t; high--; } else if(a
2017-06-09 16:44:18 235
转载 c++ 49,50,,51
49#includeint a[]={0,1,2,5,8,7,6,3}; /*指针数组.依次存入矩阵中构成环的元素下标*/int b[9]; /*表示3X3矩阵,b[4]为空格*/int c[9]; /*确定1所在的位置后,对环进行调整的指针数组*/int count=0;
2017-06-09 16:15:21 300
转载 技术博客003
从Qobject(QObject.h)源码中可以看到QObject::connect的定义是这样的:[cpp] view plain copystatic bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *membe
2017-06-09 16:01:03 152
转载 c++-10
#include using namespace std; int main(){ int i,j,k; // p[2][3][4] int ***p; p = new int **[2]; for(i=0; i<2; i++) { p[i]=new int *[3]; for(j=0; j
2017-06-09 15:39:06 148
转载 c++-08
#include using namespace std; int main(){ int **p; int i,j; //p[4][8] //开始分配4行8列的二维数据 p = new int *[4]; for(i=0;i<4;i++){ p[i]=new int [8]; } for(i=0
2017-06-09 15:35:43 124
转载 c++-06
如何利用new与delete实现动态内存#include using namespace std; int main (){ double* pvalue = NULL; // 初始化为 null 的指针 pvalue = new double; // 为变量请求内存 *pvalue = 29494.99; // 在分配的地址存储值 cout <
2017-06-09 15:01:41 163
转载 c++-04
数据封装的实例#include using namespace std; class Adder{ public: // 构造函数 Adder(int i = 0) { total = i; } // 对外的接口 void addNum(int number) {
2017-06-09 14:42:01 198
转载 c++-02
C++ 中的函数重载#include using namespace std; class printData { public: void print(int i) { cout << "Printing int: " << i << endl; } void print(double f) { cout
2017-06-08 17:13:29 126
转载 c++-01
访问数据成员类的对象的公共数据成员可以使用直接成员访问运算符 (.) 来访问。#include using namespace std; class Box{ public: double length; // 长度 double breadth; // 宽度 double height; // 高度}; int m
2017-06-08 17:09:35 116
转载 java-09
通过继承Thread来创建线程class ThreadDemo extends Thread { private Thread t; private String threadName; ThreadDemo( String name) { threadName = name; System.out.println("Creating " +
2017-06-08 17:01:53 184
转载 java-08
创建线程并开始让它执行的实例:class RunnableDemo implements Runnable { private Thread t; private String threadName; RunnableDemo( String name) { threadName = name; System.out.println("Crea
2017-06-08 16:58:26 127
转载 java-07
遍历 Map实例publicclassTest{ publicstaticvoidmain(String[]args) { MapString,String>map =newHashMapString,String>(); map.put("1","value1");
2017-06-08 16:34:37 123
转载 java-06
遍历 ArrayList实例publicclassTest{ publicstaticvoidmain(String[]args) { ListString> list=newArrayListString>(); list.add("Hello"); list.add("World"
2017-06-08 16:29:35 160
转载 java-05
super 与 this 关键字publicclassSuperDemo{publicstaticvoidmain(String[]args){newSubClass().showMessage();}}classSuperClass{inti =50;}classSubClassexten
2017-06-08 16:13:42 110
转载 java-04
implements关键字使用 implements 关键字可以变相的使java具有多继承的特性,使用范围为类继承接口的情况,可以同时继承多个接口(接口跟接口之间采用逗号分隔)。publicinterfaceA{ publicvoideat(); publicvoidsleep();} publicinterfaceB
2017-06-08 16:11:30 89
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人