请教一个关于cxf做服务端时,webservice发布地址的问题
1个回答
展开全部
关于cxf做服务端时,webservice发布地址的问题
就是输入5个0 到100的数然后存入文件嘛。
import java.io.File;import java.io.FileWriter;import java.io.IOException;import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); File file = new File("c:\\1.txt"); FileWriter fw = null; int count = 0; try { fw = new FileWriter(file); while(true){ System.out.print("输入第[ "+ (count + 1) +" ]个学生成绩(0~100): "); int temp = sc.nextInt(); if(temp <= 100 && temp >= 0){ count++; fw.write(String.valueOf(temp)); fw.write("\r\n"); fw.flush(); }else{ System.out.println("输入的数不在范围之内,重新输入."); continue; } if(count == 5){ System.out.println("输入结束."); break; } } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); }finally{ if(fw != null){ try { fw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }}
就是输入5个0 到100的数然后存入文件嘛。
import java.io.File;import java.io.FileWriter;import java.io.IOException;import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); File file = new File("c:\\1.txt"); FileWriter fw = null; int count = 0; try { fw = new FileWriter(file); while(true){ System.out.print("输入第[ "+ (count + 1) +" ]个学生成绩(0~100): "); int temp = sc.nextInt(); if(temp <= 100 && temp >= 0){ count++; fw.write(String.valueOf(temp)); fw.write("\r\n"); fw.flush(); }else{ System.out.println("输入的数不在范围之内,重新输入."); continue; } if(count == 5){ System.out.println("输入结束."); break; } } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); }finally{ if(fw != null){ try { fw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询