背景 代码 先上布局文件:
这里没有TextView,我最后是将路径以System.out.println方式输出的。初始化:button =
(Button)findViewById(R.id.button); pic = (ImageView) findViewByI...
分类:
移动开发 时间:
2014-05-17 01:44:20
阅读次数:
749
public class Test { public static void
main(String[] string){ int i = Integer.MAX_VALUE; System.out.println(i); ...
分类:
其他好文 时间:
2014-05-15 10:13:33
阅读次数:
224
解决办法:
如果是采用流的方式一行一行写到文件中,可以把FileWriter换为PrintWriter,然后调用PrintWriter的println()方法。
byte fileContent[] = getJTextArea().getText().replaceAll("\n", "\r\n").getBytes();//此处主要是为了在Windows中实现换行操...
分类:
其他好文 时间:
2014-05-15 06:12:57
阅读次数:
244
1.简单Java多线程例子(继承Thread)publicclasshelloextendsThread{
privateStringname;
publichello(Stringname){
this.name=name;
}
publicvoidrun(){
for(inti=0;i<5;i++){
System.out.println(name+"运行..."+i);
}
}
publicstaticvoidmain(String[]args){
hellohel..
分类:
编程语言 时间:
2014-05-14 17:45:57
阅读次数:
318
public class BubbleSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sorting ,t.....
分类:
编程语言 时间:
2014-05-13 19:45:04
阅读次数:
366
1. 下面的代码运行后,将输出什么结果? String s1 = new String("Test"); String s2 = new String("Test"); if (s1==s2)
System.out.println("Same"); if (s1.equals(s2))
System.out.println("Equals");
A. Same...
分类:
编程语言 时间:
2014-05-13 07:42:26
阅读次数:
306
1、选择表达式中的类型转换public class Test { public void static
main(String args[]){ int i = 5; System.out.println("Vlaue Is " + ((...
分类:
编程语言 时间:
2014-05-12 09:39:52
阅读次数:
294
public class TestA {
private String ta="我是类TestA"; public String fiall() {//System.out.println(this.ta);return ta; }}
上面第一个类,作为父类
------------------------------------------------------------------...
分类:
编程语言 时间:
2014-05-11 03:37:10
阅读次数:
358
public class TestSelectSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sortin.....
分类:
编程语言 时间:
2014-05-10 05:04:52
阅读次数:
322
public class InsertSort{ public static void
main(String[] args){ int[] sortArray = new int[]{5,7,4,2,9,8,3,6};
System.out.println("before sorting ,t.....
分类:
编程语言 时间:
2014-05-10 03:13:15
阅读次数:
342