Results 1 to 2 of 2
- 05-03-2012, 09:14 AM #1
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
reading and rewriting ( about String )
Hi guys
for example, there's a test.xlsx with 3 on A1, hello on B1
my code is like below
---------------------------------------------------------------------
InputStream inp = new FileInputStream("C:/work/test.xlsx");
Workbook wb = WorkbookFactory.create(inp);
Sheet sheet = wb.getSheetAt(0);
Row row = sheet.getRow(0);
Cell cell = row.getCell(0);
if(cell.getNumericCellValue() == 3) // A1 에 있던 숫자가 3 이랑 같냐?
System.out.println("3 is 3");
else
System.out.println("3 is not 3");
cell=row.getCell(1);
if(cell.getStringCellValue() == "hello") // A2 에 있던 문자가 hello 랑 같냐?
System.out.println("hello is hello");
else
System.out.println("hello is not hello");
----------------------------------------------------------------------------------
Result I expected is that
3 is 3
hello is hello
but the actual result is that
3 is 3
hello is not hello
Could you explain what the matter is?
- 05-03-2012, 09:27 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
rewriting a recursive function
By Wnt2bsleepin in forum New To JavaReplies: 6Last Post: 04-19-2012, 05:48 PM -
Arguments for/against rewriting API classes/methods?
By Diargg in forum Advanced JavaReplies: 3Last Post: 04-04-2012, 03:18 PM -
Reading characters into a string
By Teclis in forum New To JavaReplies: 2Last Post: 03-08-2011, 10:08 PM -
Problem with search, when I rewriting index
By Petr in forum LuceneReplies: 0Last Post: 01-13-2011, 10:58 AM -
url rewriting
By jithan in forum Java ServletReplies: 2Last Post: 06-23-2008, 06:11 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks