求元素个数:
import java.util.*;
public class XianXingBiao { /**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根
Collection coll;
coll=new A();
coll.Count();
}}
interface Collection{
int Count(int size);
}
class A implements Collection{
void count (int size){
int i=0;
int a=new int[i];
System.out.println("请输入元素序列:");
Scanner reader=new Scanner(System.in);
a=reader.nextInt();
if(a[i]!='\0')
i++;
else size=i;
System.out.println("该元素序列的元素个数为:"+size);
}
}
import java.util.*;
public class XianXingBiao { /**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根
Collection coll;
coll=new A();
coll.Count();
}}
interface Collection{
int Count(int size);
}
class A implements Collection{
void count (int size){
int i=0;
int a=new int[i];
System.out.println("请输入元素序列:");
Scanner reader=new Scanner(System.in);
a=reader.nextInt();
if(a[i]!='\0')
i++;
else size=i;
System.out.println("该元素序列的元素个数为:"+size);
}
}
没得改了
tell us what u want to do ?
他得意思是从键盘输入一个整数
// How to read from standard input.
// {RunByHand}
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.package c11;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;public class Echo {
public static void main(String[] args)
throws IOException {
BufferedReader in = null;
in =
new BufferedReader(
new InputStreamReader(System.in));
String s;
String s2 = null;
while((s = in.readLine()).length() != 0) {
s2 = s;
}
String[] str = s2.split(",");
System.out.println("size is " + str.length);
System.out.println("the char you input is: ");
for (int i = 0; i < str.length; i++) {
if (i != str.length - 1) {
System.out.print(str[i] + ",");
} else {
System.out.print(str[i]);
}
}
in.close();
}
} ///:~
======================================
a, c, luyang. , luyang,,dsfsaffadsdsize is 6
the char you input is:
a, c, luyang. , luyang,,dsfsaffadsd如果你想‘\0’结束的话,你自己可以修改一下就可以了。
一、JAVA基础培训
1.孙鑫Java无难事(共108集 SWF格式)
2.张孝祥Java就业培训(共56集 RM/RMVB格式)
3.翁凯Java语言视频培训(共30讲 CSF格式)
二、JAVA进阶培训
1.吉林大学远程JSP培训(共32讲 AVI格式)
2.西安电子科技大学JSP在线课程(共35讲 AVI格式)
3.JSP数据库系统开发培训( ISO格式 内含电子书及相关源代码)
4.刘晓涛JAVA UML核心基础(共6集 RM/RMVB格式 )
5.J2EE专题系列讲座之Struts(共5讲 AVI格式 )
6.赛迪网校J2EE软件工程师培训(J2EE基础13集 高级17集 案例7集)
7.J2EE Web程序开发(共38集)
8.天峰培训J2EE快速进阶培训视频(共33讲 AVI格式)
三、JAVA实战项目培训录像
1.北京尚学堂科技_马士兵老师_项目实战手把手java视频教程-坦克大战
2.北京尚学堂科技_马士兵老师_项目实战手把手j2se视频教程-Chat
3.北京尚学堂科技_马士兵老师_项目实战手把手BBS教程
四、数据库方面
1.Oracle 9i DBA中文视频远程班培训录像(共64集 AVI格式)
*1Z0-007 Introduction to Oracle9i SQL
*1Z0-031 Oracle9i DBA Fundamentals I
*1Z0-032 Oracle9i DBA Fundamentals II
*1Z0-033 Oracle9i Performance Tuning
另附全套PPT培训讲稿。
2.中科院Oracle 10G 数据库培训录像(共18集 rmvb格式)联系方式:
QQ:421130479
MSN:[email protected]
E-mail:[email protected]
设计并实现一个windows系统中的“计算器”的窗口及功能。要求:至少要有0——9时个数字按钮,可以实现加,减,乘,除四运算。