Time of Update: 2018-12-04
一、Sting類是對字串事物的描述,該類定義了專門用於操作字串的方法。它是一個final類,不能被繼承。String s1="java"; Strings2="java" String類在java中採用了享元設計模式,s1和s2兩個引用變數指向了同一個記憶體位址。s1==s2 為true.String s=new String("java") ;建立了兩個對象,"java"是一個匿名對象,new關鍵字在對記憶體又建立一個對象。二、String類常用方法列舉1.擷取。1.1
Time of Update: 2018-12-04
MyTriangle.hclass Triangle{public:Triangle(){a = 1; b = 1; c = 1;}Triangle(double x, double y, double z){a = x; b = y; c = z;}double area(void);double perimeter(void);private:double a, b, c;};MyTriangle.cpp#include "stdafx.h"#include
Time of Update: 2018-12-04
<pre class="plain" name="code">/* (程式頭部注釋開始) * 程式的著作權和版本聲明部分 * Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved. * 檔案名稱: C++第十周【任務2】 * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月
Time of Update: 2018-12-04
利用BroadcastReceiver實現搶購倒計時,當然你也可以用Thread+Handler來完成。實際應用中我們倒計時的時間是從服務端擷取的。運行效果:布局檔案:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
Time of Update: 2018-12-04
<pre class="plain" name="code">/* (程式頭部注釋開始) * 程式的著作權和版本聲明部分 * Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved. * 檔案名稱: C++第十周【任務3】 * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月 14
Time of Update: 2018-12-04
echo、@、call、pause、rem 是批次檔最常用的幾個命令,我們就從他們開始學起。 echo 表示顯示此命令後的字元 echo off 表示在此語句後所有啟動並執行命令都不顯示命令列本身 @ 與echo off相象,但它是加在其它命令列的最前面,表示運行時不顯示命令列本身。 call 調用另一條批次檔(如果直接調用別的批次檔 ,執行完那條檔案後將無法執行當前檔案後續命令) pause 運行此句會暫停,顯示Press any key to
Time of Update: 2018-12-04
03.#include<iostream> 04.#include<Cmath> 05.using namespace std; 06. 07.enum SymmetricStyle {axisx, axisy, point}; //分別表示按x軸, y軸, 原點對稱 08.class CPoint 09.{ 10.private: 11. double x; // 橫座標 12. double y; // 縱座標
Time of Update: 2018-12-04
在布局檔案中:<RatingBar style="@style/myRatingBar" //使用樣式 android:layout_marginLeft="10dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/rbar"></RatingBar>在values檔案夾下的 styles.xml檔案夾中<?xml
Time of Update: 2018-12-04
01.#include <iostream> 02.using namespace std; 03.class Time 04.{public: 05. Time(int h,int m,int s):hour(h),minute(m),sec(s){} 06. void display1(); //成員函式宣告 07. friend void display2(Time &); //友元函式宣告 08. int
Time of Update: 2018-12-04
/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者:鮑增凱 * 完成日期: 2012 年 5 月 7 日* 版 本 號:01.#include<iostream.h> 02.
Time of Update: 2018-12-04
06.#include<iostream> 07.#include<Cmath> 08.using namespace std; 09. 10.class CPoint 11.{ 12.private: 13. double x; // 橫座標 14. double y; // 縱座標 15.public: 16. void input(); //以x,y 形式輸入座標點 17. float
Time of Update: 2018-12-04
/* (程式頭部注釋開始)* 程式的著作權和版本聲明部分* Copyright (c) 2011, 煙台大學電腦學院學生 * All rights reserved.* 檔案名稱: * 作 者: 鮑增凱 * 完成日期: 2012 年 5 月 7 日* 版 本 號:01.#include <iostream> 02.using
Time of Update: 2018-12-04
01.#include <iostream> 02. 03.using namespace std; 04.class Complex 05.{ 06.public: 07. Complex(){real=0;imag=0;} 08. Complex(double r,double i){real=r;imag=i;} 09. Complex operator+(Complex &c2); 10. Complex operator-(
Time of Update: 2018-12-04
01.#include<iostream> 02.#include<Cmath> 03.using namespace std; 04. 05.class CPoint 06.{ 07.private: 08. double x; // 橫座標 09. double y; // 縱座標 10.public: 11. void input(); //以x,y 形式輸入座標點 12. float
Time of Update: 2018-12-04
我們知道View在螢幕上顯示出來要先經過measure和layout. 在調用onMeasure(int widthSpec, int heightSpec)方法時,要涉及到MeasureSpec的使用,MeasureSpec有3種模式分別是UNSPECIFIED, EXACTLY和AT_MOST, 那麼這些模式和我們平時設定的layout參數fill_parent,
Time of Update: 2018-12-04
01.#include<iostream> 02.using namespace std; 03.class C 04.{ 05.private: 06. int x; 07.public: 08. C(int x){this->x = x;} 09. int getX(){return x;} 10.}; 11. 12.void main() 13.{ 14. C c(5); //將原程式中 const 去掉 1
Time of Update: 2018-12-04
1,切換到root 使用者2,點擊VMware的 VM選項,點settings,在hardware選項點CD/DVD,在USe ISO image file裡 選擇vmware安裝目錄的,我的是在C:\Program Files\VMware\VMware Workstation\linux.iso,這個。so檔案就相當於是vmware TOOls的安裝檔案3,設定完畢後,進到終端,root下。點 uname -r 查看核心版本, rpm -q kernel-devel
Time of Update: 2018-12-04
#include <iostream>using namespace std;class Time{public: void set_time();void show_time(); void change_time(); void add_seconds(int n); void add_minutes(int n); void add_hours(int n);private:bool is_time(int,int,int); void
Time of Update: 2018-12-04
03.#include<iostream> 04.using namespace std; 05.class A 06.{ 07.private: 08. int a; 09.public: 10. A(){a = 0;} 11. A(int aa):a(aa){} //定義建構函式,用參數aa初始化資料成員a 12.}; 13. 14.void main() 15.{ 16. A *p;
Time of Update: 2018-12-04
#include<iostream>using namespace std;class Box{public:void get_value();void display();float volume();float area();private:float length;float width;float height;};void Box::get_value(){cout<<"please input length,width,height:";cin>>