C++与Java基本数据类型比较
C++与Java基本数据类型及所占用内存空间比较
----------------C++
----------- ------------Java
----------
(01)bool------------------1 byte 01)boolean--1 byte
(02)char------------------1 byte
02)char------2 bytes
(03)signed char---------1 byte 03)byte------1 byte
(04)unsigned char------1 byte
(05)wchar_t--------------2 bytes
(06)short-----------------2 bytes 04)short-----2 bytes
(07)unsigned short-----2 bytes
(08)int--------------------4 bytes 05)int---------4 bytes
(09)unsigned int--------4 bytes
(10)long------------------4 bytes
06)long-------8 bytes
(11)unsigned long-------4 bytes
(12)long long-------------8 bytes
(13)unsigned long long--8 bytes
(14)float-------------------4 bytes 07)float-------4 bytes
(15)double----------------8 bytes &nbs
相关文档:
说到GB2312和GBK就不得不提中文网页的编码。尽管很多新开发的Web系统和新上线的注重国际化的网站都开始使用UTF-8,仍有相当一部分的中文媒体坚持使用GB2312和GBK,例如新浪的页面。其中有两点很值得注意。
第一,页面中meta标签的部分,常常可以见到charset=GB2312这样的写法,很不幸的是,这个“cha ......
学习Java程序主要包含以下四个部分。
(1)编辑代码 edit code
(2)保存代码 save code
(3)编译代码 compiler code
(4)运行程序 run program
第一个程序文件HelloWorld.java
public class HelloWorld {
public static void main(String[] args){
......
import java.io.*;
class BigInt
{
int a[];
int len;
BigInt(String str)
{
{
len=str.length();
a=new int[len];
for(int i=0;i<len;i++)
{
this.a[i]=str.charAt(i)-48;
}
&nb ......
JAVA常用类的使用方法
1、Integer类
2、Float类
3、Double类
4、Character类
5、String类
6、StringTokenizer类
7、StringBuffer类
8、Random类
1.Integer类的使用方法
Interger:整数类型
1、属性。
static int MAX_VALUE:返回最大的整型数;
static int MIN_VALUE:返回最小的整型数;
static C ......
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.*;
public class ReadXML {
private File file;
public ReadXML(String filename){
File file=new File(filename);
this.file=file;
}
/**
......