首页 > 编程语言 > 详细

Java经典习题46

时间:2020-02-24 21:46:26      阅读:71      评论:0      收藏:0      [点我收藏+]

/*
题目:两个字符串连接程序。
*/

import java.util.*;

public class Class46 {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
System.out.println("输入一个字符串");
String str1 = sc.nextLine();
System.out.println("请再输入一个字符串");
String str2 = sc.nextLine();
String str = str1 + str2;
System.out.println("连接后的字符串是:" + str);

}

}

Java经典习题46

原文:https://www.cnblogs.com/zhuozige/p/12358841.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!