package fuck;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;  
import jxl.Cell;   
import jxl.CellType;   
import jxl.Sheet;   
import jxl.Workbook;   
import jxl.write.Label; 

public class ExcelOperater    
{   
  
    public static void main(String[] args)    
    {   
  
        jxl.Workbook readwb = null;   
        try    
        {   
  
            //构建Workbook对象, 只读Workbook对象   
  
            //直接从本地文件创建Workbook   
  
            InputStream instream = new FileInputStream("D:/input_data.xls");   //这个jar包只支持xls的文件
  
            readwb = Workbook.getWorkbook(instream);   
            //Sheet的下标是从0开始   
  
            //获取第一张Sheet表   
  
            Sheet readsheet = readwb.getSheet(0);   
  
            //获取Sheet表中所包含的总列数   
  
            int rsColumns = readsheet.getColumns();   
  
            //获取Sheet表中所包含的总行数   
  
            int rsRows = readsheet.getRows();   
  
            //获取指定单元格的对象引用   
  
            for (int i = 0; i < rsRows; i++)   
            {   
                for (int j = 0; j < rsColumns; j++)   
                {   
                    Cell cell = readsheet.getCell(j, i);   
                    System.out.print(cell.getContents() + " ");   
                }   
                System.out.println();   
            }   
        } 
	    catch (Exception e) 
	       {   
	            e.printStackTrace();   
	       } 
	    finally 
	       {   
	            readwb.close();   
	       }
    }   
}   

image 最新2020整理收集的一些高频面试题(都整理成文档),有很多干货,包含mysql,netty,spring,线程,spring cloud、jvm、源码、算法等详细讲解,也有详细的学习规划图,面试题整理等,需要获取这些内容的朋友请加Q君样:909038429 /./*欢迎加入java交流Q君样:909038429一起吹水聊天