💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ package io.a5; import java.io.*; //转换流是将java不允许的情况变成可能,System.in是字节流,new InputStreamReader(System.in)是将字节流转成字符流 public class Test { public static void main(String[] args) { System.out.println("****" ); String zfc = null; try { BufferedReader zhl = new BufferedReader(new InputStreamReader(System.in) ); zfc = zhl.readLine(); System.out.println("字符串是 " + zfc); } catch (Exception e) { } } } ~~~ ![](https://box.kancloud.cn/1d5b60b8c6f020dd1d980a5cd9a010e5_186x104.png)