继承总结:
class
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
class Fu
{
private int num = 9;
public void show1(){}
public void setNum(int num)
{
this...
分类:
编程语言 时间:
2014-12-18 11:57:57
阅读次数:
236
class Factory
{
static Factory factory = new Factory();
private Factory(){}
int num =0;
public static Factory getInstance()
{
return factory;
}
public void jiaGong()
{
System.out.println(...
分类:
编程语言 时间:
2014-12-18 10:25:16
阅读次数:
205
Testpublic class Test{ public static void main(Stirng[] args){ system.out.println("123"); } }
分类:
其他好文 时间:
2014-12-18 10:17:03
阅读次数:
119
public class Calcsizof {
/**
* @param args
*/
private static void calSize() {
System.out.println("Integer: " + Integer.SIZE/8); // 4
System.out.println("Short: " + Short.SIZE/...
分类:
编程语言 时间:
2014-12-17 22:45:41
阅读次数:
232
收集了几个易错的或好玩的Java输出题,分享给大家,以后在编程学习中稍微注意下就OK了。1. 看不见的空格?下面的输出会正常吗?package basic;
public class IntegerTest {
public static void main(String[] args) {
System.out.println(Integer.parseInt("1"...
分类:
编程语言 时间:
2014-12-17 21:03:59
阅读次数:
194
首相有两种一个是java里的
try{
}catch()
{
}
第二种是
Error message:
out.println('.........');
%>
例如:
String path = request.getContextPath();
String basePath = request.getScheme()...
分类:
编程语言 时间:
2014-12-17 09:50:43
阅读次数:
151
swift的String类没有contains这样类型的方法来直接判断字符串中是否包含另一段字符串,但是,可以变通的来实现。
直接上代码:
if "这是一段字符串".componentsSeparatedByString("字符串").count > 0 {
println("包含")
} else {
println("不包含")
}
简单说一下:
component...
分类:
编程语言 时间:
2014-12-16 21:00:22
阅读次数:
192
如下代码:publicclassExample003{
publicstaticvoidmain(String[]args){
finallongMICROS_PER_DAY=24*60*60*1000*1000;
finallongMICROS_PER_DAY_L1=24*60*60*1000*1000L;
finallongMILLIS_PER_DAY=24*60*60*1000;
System.out.println("NOLPrint:"+MICROS_PER_DAY/M..
分类:
编程语言 时间:
2014-12-16 19:23:03
阅读次数:
191
Android开发中在代码中通过System.out.println调试输出在Logcat窗口中可以看到。但Logcat视图中夹杂了太多的其它App及底层的信息,看起来并不明朗。可以在Logcat视图中新建一个Message Filter。操作如下:在Logcat窗口下单击绿色“+”;Filter ...
分类:
其他好文 时间:
2014-12-16 16:42:52
阅读次数:
150
Scanner input = new Scanner(System.in); System.out.println("请输入一个数字"); int a=input.nextInt(); System.out.println("请输入一个字符串"); String b=input.nex...
分类:
其他好文 时间:
2014-12-16 13:16:07
阅读次数:
133