小编use*_*319的帖子

Math.abs为Integer.Min_VALUE返回错误的值

这段代码:

System.out.println(Math.abs(Integer.MIN_VALUE));
Run Code Online (Sandbox Code Playgroud)

返回 -2147483648

它不应该返回绝对值2147483648吗?

java absolute-value

77
推荐指数
4
解决办法
2万
查看次数

强制或生成jvm核心转储(IBM JVM)

可能重复:
我可以强制生成JVM崩溃日志文件吗?

如何在Java应用程序服务器上或一般情况下强制或生成JVM核心转储?

java apache websphere jvm java-ee

17
推荐指数
1
解决办法
7万
查看次数

apache端口80非root

我如何使用apache端口80作为非root用户,因为我知道不建议使用少于1024.

apache port root

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

反向链表问题

我在java中有以下链表程序,除反向链表功能外,它工作正常.我错过了什么?

public class LinkedList {

private Link first;

public LinkedList()
{
    first = null;
}
public boolean isEmtpy()
{
    return(first==null);
}

public void insertFirst(int id, double dd)
{
    Link newLink=new Link(id,dd);
    newLink.next=first;     //new link --> old first
    first =newLink;         //first --> newLink
}
public Link deleteFirst()
{
    Link temp=first;
    first=first.next;
    return temp;
}
public void displayList()
{
    Link current=first;
    System.out.println("List (first-->last)");
    while(current!=null)
    {
        current.displayLink();
        current=current.next;
    }       
    System.out.println(" ");
}
public Link find(int key)
{
    Link current=first;

    while(current.iData!=key)
    {
        if(current.next==null)
            return …
Run Code Online (Sandbox Code Playgroud)

java reverse linked-list

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

替换字符串java Scanner类

import java.util.*;
public class ReplaceString {
    public static void main(String[] args) {
        new ReplaceString().run();
    }

    public void run()
    {

        System.out.println("Input String:\n");
        Scanner keyboardScanner = new Scanner(System.in);
        String inString = keyboardScanner.nextLine();
        String strOutput = inString.replace("is","was");
        System.out.println(strOutput);      

    }
}
Run Code Online (Sandbox Code Playgroud)

我试图用输入的行替换所有出现的"is"和"was",我能够做但我不想弄乱"is"是单词的一部分.

例如,任何出现的单词nameis或this都应该被忽略.只有"是"的个别出现应该替换为"是"

我知道我可以使用正则表达式,但我不知道格式是否正则表达式

java regex string substring

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