Java – use system out. Println() creates a border

Anyway, has this arrangement been created, and no string variable SH3 affects the boundary? I'm really sorry that my knowledge of Java is almost limited to what you see here. If it helps?

System.out.println("###################################################"); 
System.out.println("#    **** WEST END THEATRE BOOKING SYstem ****    #"); 
System.out.println("#                                                 #"); 
System.out.println("#                 T I C K E T                     #"); 
System.out.println("#                                                 #"); 
System.out.println("#     Show:    "+sh3+"                            #"); 
System.out.println("#     Theatre: Her Majesty's                      #"); 
System.out.println("#     Price:   65                                 #"); 
System.out.println("###################################################");

Solution

I know I didn't provide code for this, but I mean thinking about the process and leaving the implementation to you

You know the total size of the line, you know the length of the string, and you know how much space is left to find it easily

All you need is a loop that will calculate the remaining space

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>