小编tra*_*ama的帖子

使用.contains方法忽略大小写的选项?

有没有选择忽略.contains()方法的情况?

我有一个ArrayListDVD对象.每个DVD对象都有一些元素,其中一个是标题.我有一个搜索特定标题的方法.它有效,但我希望它不区分大小写.

java list arraylist

40
推荐指数
6
解决办法
10万
查看次数

构建Sencha/ExtJS 5项目时的java.lang.StackOverflowError

当我打开我的项目并且Eclipse尝试构建它时,我收到此错误:在"构建工作区"期间发生内部错误.java.lang.StackOverflowError的.

它仍然完成建设(我认为),我可以继续.但我得到一个"内部错误"弹出窗口,说已发生堆栈溢出,并建议我退出工作台.我只是忽略了弹出窗口.

这是我的.log输出:

!SESSION 2014-11-13 09:22:21.634 -----------------------------------------------
eclipse.buildId=4.4.0.I20140606-1215
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data C:\Workspaces\pvmui-ws3

!ENTRY org.eclipse.egit.ui 2 0 2014-11-13 09:22:31.052
!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level
Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory.
The most important of these settings is core.autocrlf. Git …
Run Code Online (Sandbox Code Playgroud)

javascript java eclipse extjs

6
推荐指数
1
解决办法
993
查看次数

为什么我会收到此异常错误?

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at assg3_Tram.DVDCollection.remove(DVDCollection.java:60)
at assg3_Tram.DVDApplication.main(DVDApplication.java:95)
Run Code Online (Sandbox Code Playgroud)

我通过在我的开关/案例中选择选项4(从列表中删除DVD对象)来启动我的程序.然后我输入"Adam",成功删除.然后菜单再次重复,我再次选择4以删除"神秘河".这也成功地删除了.菜单再次重复,我再次选择4.这次我输入"Mystic Rivers"(用's'来测试DVD不在列表中),然后弹出错误.我已经包含了相关代码和我正在阅读的.txt列表.

我使用.txt文件中的信息填充ArrayList.每个DVD对象有5条信息.每件作品都是一条独立的线.

public DVD remove(String removeTitle) {
    for (int x = 0; x <= DVDlist.size(); x++) {
        if (DVDlist.get(x).GetTitle().equalsIgnoreCase(removeTitle)) { // This is line 60.
            DVD tempDVD = DVDlist.get(x);
            DVDlist.remove(x);
            System.out.println("The selected DVD was removed from the collection.");
            wasModified = true;
            return tempDVD;
        }
    }

    System.out.println("DVD does not exist in the current collection\n");
    wasModified = false;
    return null;
}
Run Code Online (Sandbox Code Playgroud)

在我的主班: …

java exception

2
推荐指数
1
解决办法
121
查看次数

如何在命令行中读取浮点数?

如何在命令行中读取浮点数或整数?

test.py 11 22.4 11.7 99.9 69
Run Code Online (Sandbox Code Playgroud)

我试过了:

numbersList = float(sys.argv[1:len(sys.argv)])
Run Code Online (Sandbox Code Playgroud)

python python-3.x

1
推荐指数
1
解决办法
4181
查看次数

为什么我收到ORA-00937错误?

这是我的oracle查询:

SELECT      DISTINCT Student.student_id, student_name, SUM(credit)
FROM        Student, Class, Enrolls
WHERE       Student.student_id = Enrolls.student_id
AND         Class.schedule_num = Enrolls.schedule_num
AND         Class.semester = Enrolls.semester
AND         grade != 'F'
AND         grade IS NOT null
ORDER BY    student_id ASC;
Run Code Online (Sandbox Code Playgroud)

查询工作正常,直到我添加SUM(credit).之后我得到:

ORA-00937: not a single-group group function
Run Code Online (Sandbox Code Playgroud)

请帮忙,谢谢.

sql oracle sqlplus

1
推荐指数
1
解决办法
98
查看次数

执行方法后如何在switch case中返回主菜单?

在选定的方法执行后,如何让菜单再次显示?

我有菜单选项打印到控制台.然后它需要用户输入(1 - 6),按方法调用,然后应返回菜单供用户再次从菜单中选择.

执行所选方法后,程序就会结束.

public static void main (String[] arg) {

    Scanner kbd = new Scanner(System.in);

    String mainMenu = ("Select a choice from the menu: \n" 
            + "1. Add new DVD entry\n" 
            + "2. Look Up DVD Entry\n"
            + "3. Display DVDs By Category\n" 
            + "4. Remove DVD Entry\n"
            + "5. Save Data\n" 
            + "6. Exit");

    System.out.println(mainMenu);

    menuChoice = kbd.nextInt();

    while (menuChoice < 1 || menuChoice > 6) {
        System.out.print("\nError! Incorrect choice.\n");
        System.out.println(mainMenu);
        menuChoice = kbd.nextInt();
    } …
Run Code Online (Sandbox Code Playgroud)

java

0
推荐指数
1
解决办法
3万
查看次数

标签 统计

java ×4

arraylist ×1

eclipse ×1

exception ×1

extjs ×1

javascript ×1

list ×1

oracle ×1

python ×1

python-3.x ×1

sql ×1

sqlplus ×1