Java中的PrintWriter类的println(long)方法用于在流上打印指定的long值,然后换行。该long值用作参数。
用法:
public void println(long longValue)
参数:此方法接受强制参数longValue,该参数是要写入流中的long值。
返回值:此方法不返回任何值。
下面的方法说明了println(long)方法的用法方式:
示例1:
// Java program to demonstrate
// PrintWriter println(long) method
import java.io.*;
class GFG {
public static void main(String[] args)
{
try {
// Create a PrintWriter instance
PrintWriter printr
= new PrintWriter(System.out);
// Print the long value '4'
// to this stream using println() method
// This will put the longValue in the
// stream till it is printed on the console
printr.println(4);
printr.flush();
}
catch (Exception e) {
System.out.println(e);
本文发布于:2024-02-04 23:25:46,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170718780760718.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |