热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

Without Book 提问

问题. Java outOfMemory exception in string.split

- Getting Java outOfMemory exception in string.split while reading each line for 60 MB file. Please suggest what need to be done?

发布时间 Jul 12, 2014 发布者 Raman
回答. You should try first is reduce the file to small enough that it works. That will allow you to appraise just how large a problem you have.

Just a general Java note: don't write
String s1 = new String(tokens[0]);
String s2 = new String(tokens[1]);

Just need to write:
String s1 = tokens[0];
String s2 = tokens[1];

or even just use tokens[0] directly instead of s1, since it's about as clear.
发布时间 Jul 12, 2014 发布者 Arindam

输入你的回答

姓名
邮箱地址
回答
安全验证
继续前请计算: 2 + 8 = ?
版权所有 © 2026,WithoutBook。