当前位置:网站首页>打印流与System.setout();
打印流与System.setout();
2022-07-01 04:46:00 【洋啊桑815】
import java.io.*;
public class Test1 {
public static void main(String[] args) throws Exception {
//打印流
PrintStream pa=new PrintStream("");
pa.print("这是一个打印流,这里可以打印任意类型的数据");
PrintWriter pw=new PrintWriter("");
pw.print("这是一个打印流,这里可以打印任意类型的数据");
//上面这两个流在打印功能上没有区别
System.setOut(pa);
System.out.println("这里面是内容经过上一行的改变就会直接打印到对应的文件中去");
}
边栏推荐
- Difficulties in the development of knowledge map & the importance of building industry knowledge map
- Shell之分析服务器日志命令集锦
- 分布式全局唯一ID解决方案详解
- 1076 Forwards on Weibo
- LM小型可编程控制器软件(基于CoDeSys)笔记十九:报错does not match the profile of the target
- Pytest automated testing - compare robotframework framework
- LeetCode_ 53 (maximum subarray and)
- LeetCode_35(搜索插入位置)
- 解决:Thread 1:[<*>setValue:forUndefinedKey]:this class is not key value coding-compliant for the key *
- This sideline workload is small, 10-15k, free unlimited massage
猜你喜欢

Pytorch convolution operation

Extension fragment

Cmake selecting compilers and setting compiler options

I also gave you the MySQL interview questions of Boda factory. If you need to come in and take your own

2022 question bank and answers for safety production management personnel of hazardous chemical production units

How to do the performance pressure test of "Health Code"

【硬十宝典】——2.【基础知识】开关电源各种拓扑结构的特点

RuntimeError: “max_pool2d“ not implemented for ‘Long‘

VIM简易使用教程

Registration of P cylinder filling examination in 2022 and analysis of P cylinder filling
随机推荐
RuntimeError: mean(): input dtype should be either floating point or complex dtypes.Got Long instead
Tencent has five years of testing experience. It came to the interview to ask for 30K, and saw the so-called software testing ceiling
RuntimeError: “max_pool2d“ not implemented for ‘Long‘
Neural networks - use of maximum pooling
RuntimeError: mean(): input dtype should be either floating point or complex dtypes. Got Long instead
Software testing needs more and more talents. Why do you still not want to take this path?
Leecode question brushing record 1310 subarray XOR query
解决:Thread 1:[<*>setValue:forUndefinedKey]:this class is not key value coding-compliant for the key *
C -- array
The design points of voice dialogue system and the importance of multi round dialogue
Shell之Unix运维常用命令
Use of dataloader
Pytorch(二) —— 激活函数、损失函数及其梯度
Neural networks - use sequential to build neural networks
CF1638E. Colorful operations Kodori tree + differential tree array
Odeint and GPU
Ten wastes of software research and development: the other side of research and development efficiency
C - detailed explanation of operators and summary of use cases
STM32 光敏电阻传感器&两路AD采集
Advanced application of ES6 modular and asynchronous programming