I need to make the output in 3 lines and also aligned by “:”, using JOptionPane.showdialogmessage(): *note the alignment of the “:” I have tried manually adding spaces before each “:” but still these 3 lines do not strictly align: Here is the output screenshot: What is the easiest way to realize this alignment? Thanks P.S.: This is my first
Tag: string-formatting
Condition to point out Error in line formatting not being met
I have a program which reads a file and enforces a certain format in every line. If a line has a format error, it prints a line below it indicating which error it was. For each line, From column 1 to …
error: incompatible types: String[] cannot be converted to String
I tried taking input of a 6 by 6 matrix in java using the string split function when the string is input in the following way, and to print the matrix. The output that I get is my code: pls, suggest how I can overcome this error Answer When we call split function of String return the String[]. So c[j]