这是我的代码.
public class SubFunction {
private String drawTribleX(){
return trible("X");
}
private String trible(String t){
return t + t + t;
}
public static void main(String[] args){
SubFunction o = new SubFunction();
System.out.println(o.drawTribleX());
}
}
Run Code Online (Sandbox Code Playgroud)
我可以这样做吗?
public class SubFunction {
private String drawTribleX(){
// *** move trible(t) inside drawTribleX() ***
private String trible(String t){
return t + t + t;
}
return trible("X");
}
public static void main(String[] args){
SubFunction o = new SubFunction();
System.out.println(o.drawTribleX());
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
按照我的代码,
Apple按原型定义功能.
香蕉是通过类属性定义函数.
var Apple = function(){}
Apple.prototype.say = function(){
console.debug('HelloWorld');
}
var Banana = function(){
this.say = function(){
console.debug('HelloWorld');
}
}
var a = new Apple();
var b = new Banana();
a.say();
b.say();
Run Code Online (Sandbox Code Playgroud)
这些不同吗?
SendKeys是将键击发送到应用程序的方法.
我可以在Javascript中执行此操作,在浏览器中发送按键吗?
参考:http :
//msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
这是我的代码,
private String memSize(String path){
StatFs stat = new StatFs(path);
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
long freeBlocks = stat.getFreeBlocks();
long countBlocks = stat.getBlockCount();
String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
String info = path.toString()
+ "\nblockSize : " + Long.toString(blockSize)
+ "\navailableBlocks : " + Long.toString(availableBlocks)
+ "\nfreeBlocks : " + Long.toString(freeBlocks)
+ "\nreservedBlocks : " + Long.toString(freeBlocks - availableBlocks)
+ "\ncountBlocks : " + Long.toString(countBlocks)
+ "\nspace : " …Run Code Online (Sandbox Code Playgroud) 目标是仅在第一次点击时显示警告框.
Ext.getCmp('myBtn').on('click', function(){
alert('Alert this message only in first click.');
Ext.getCmp('myBtn').un('click', this); // my attempt, still not work
})
Run Code Online (Sandbox Code Playgroud)
谢谢.