哪种评论方法被广泛接受或者真的重要?
我一直在用
/**
* (Method description)
* @param
* @return
* etc
*/
Run Code Online (Sandbox Code Playgroud)
不过我读过:
Precondition:
Postcondition:
Run Code Online (Sandbox Code Playgroud)
是否有更"专业"的评论方式?
我已经下载了最近发布的新的android工作室.我无法找到xml的UI设计预览,就像在eclipse中一样.对此有何帮助或建议?
我与有效的java有一点冲突.一方面,它强烈鼓励使用最终修饰符.它还鼓励使用foreach循环.
但是我没有在任何地方看到任何代码,代码如下:
for (final element e : list) {
// do whatever.
}
Run Code Online (Sandbox Code Playgroud)
如果预计元素不会改变,那么使用final似乎是好的.为什么不那么常见?
我读了以下内容:
J2ME applications, unlike normal Java applications are preverified.
J2ME jar文件的预验证究竟是什么意思?这是校验和吗?
粗糙和锯齿状阵列有什么区别?根据我的研究,两者都有相同的定义,即具有不同列长度的二维阵列.
我已经在德比Netbeans中创建了一个表,现在我意识到我需要将列作为自动递增1,这是一个主键.我怎么能这样做?我尝试了以下代码但是徒劳无功.
ALTER TABLE ISSUERECIPT ALTER IRCODE SET INCREMENT BY 1;
Run Code Online (Sandbox Code Playgroud)
我是否需要再次创建表格,还是可以通过其他方式创建表格?
我JPanel装了一个JFrame.JPanel包含4个JButtons.我想要做的是自动将焦点放在第一个jbutton上,这样我就可以在JButtons和键盘之间进行遍历.
我jButton1.requestFocusInWindow();在jpanel的构造函数中尝试了代码,但它仍然没有用.有什么东西我不见了吗?我还能做什么?
编辑:项目包含3个java文件,其代码如下:
NewJFrame.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sampleui;
import java.awt.Container;
import java.awt.Toolkit;
import javax.swing.JRootPane;
import javax.swing.UIManager;
/**
*
* @author Administrator
*/
public class NewJFrame extends javax.swing.JFrame {
static Container container;
/**
* Creates new form NewJFrame
*/
public NewJFrame() {
initComponents();
rootPane= getRootPane();
container=getContentPane();
setSize(Toolkit.getDefaultToolkit().getScreenSize());
setVisible(true);
}
/**
* This method is called from within the …Run Code Online (Sandbox Code Playgroud) 我有一个像这样的字符串:
String str = "Friday 1st August 2013"
Run Code Online (Sandbox Code Playgroud)
我需要检查:如果字符串包含"任何数字"后跟"st"字符串,则打印"是",否则打印"否".
我想:if ( str.matches(".*\\dst") )和if ( str.matches(".*\\d.st") ),但它不工作.
有帮助吗?
对Android项目来说是一个新手.我试着TabHost在Android中使用控制器.我有这个链接的代码,coderzheaven.com.但是,在这段代码中,我收到了一个错误Syntax error, insert ";" to complete.这是我的代码,
package tab.fragment;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
public class TabBarSample extends TabActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
TabSpec firstTabSpec = tabHost.newTabSpec("tab_id1");
TabSpec secondTabSpec = tabHost.newTabSpec("tab_id2");
TabSpec thirdTabSpec = tabHost.newTabSpec("tab_id3");
firstTabSpec.setIndicator("Time").setContent(new Intent(this,Time.class));
secondTabSpec.setIndicator("Date").setContent(new Intent(this,Date.class));
thirdTabSpec.setIndicator("Option").setContent(new Intent(this,Option.class));
tabHost.addTab(firstTabSpec);
tabHost.addTab(secondTabSpec);
tabHost.addTab(thirdTabSpec); //Here the error occuring..
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?请帮我.提前致谢.
我正在使用iText生成我的自定义.pdf文档.我尝试了很多,但我无法做到包含图像的文本的理想设计.我需要一个输出,如下所示:

我已经尝试过Chunk类和Paragraph类,但我无法得到所需的.有任何想法吗?