码迷,mamicode.com
首页 >  
搜索关键字:println    ( 5792个结果
Android -- 打开本地图片且显示路径
背景 代码 先上布局文件: 这里没有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
JTextArea内容保存到txt文件上,如何实现换行
解决办法: 如果是采用流的方式一行一行写到文件中,可以把FileWriter换为PrintWriter,然后调用PrintWriter的println()方法。 byte fileContent[] = getJTextArea().getText().replaceAll("\n", "\r\n").getBytes();//此处主要是为了在Windows中实现换行操...
分类:其他好文   时间:2014-05-15 06:12:57    阅读次数:244
Java多线程
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
java 语言实现冒泡排序
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
Java笔试题1
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
Java 拾遗
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
java 接口 继承 的有趣现象
public class TestA { private String ta="我是类TestA"; public String fiall() {//System.out.println(this.ta);return ta; }} 上面第一个类,作为父类 ------------------------------------------------------------------...
分类:编程语言   时间:2014-05-11 03:37:10    阅读次数:358
java 语言实现选择排序
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
java 语言实现插入排序
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!