package Java2; import java.awt.*; import java.awt.event.*; public class Demo1 { public static void Array(String[] args) { // string array for x String[] x = {"x x"," x x "," x "," x x ","x x"}; // string array for y String[] y = {"y y"," y y "," y "," y "," y "}; // string array for z String[] z = {"zzzzz"," z "," z ","z ","zzzzz"}; } public static void main(String[] args) { char input; int i; for (i = 0; i < x.length; ++i) { printx=x[i] ; printy=y[i] ; printy=z[i] ; input='xz'; if (input.char(0)='x'&&input.char(1)='z;') { System.out.println(printx + " " + " "+ printz); } else if if (input.char(0)='y'&&input.char(1)='x;') { System.out.println(printy + " " + " "+ printx); } else if if (input.char(0)='z'&&input.char(1)='y;') { System.out.println(printz + " " + " "+ printy); } } } }
Please help me fix my Java Array Method. Need to have an output like this:
Please explain what I'm missing on my code:
package Java2;
import java.awt.*;
import java.awt.event.*;
public class Demo1 {
public static void Array(String[] args) {
// string array for x
String[] x = {"x x"," x x "," x "," x x ","x x"};
// string array for y
String[] y = {"y y"," y y "," y "," y "," y "};
// string array for z
String[] z = {"zzzzz"," z "," z ","z ","zzzzz"};
}
public static void main(String[] args) {
char input;
int i;
for (i = 0; i < x.length; ++i) {
printx=x[i] ;
printy=y[i] ;
printy=z[i] ;
input='xz';
if (input.char(0)='x'&&input.char(1)='z;') {
System.out.println(printx + " " + " "+ printz);
}
else if if (input.char(0)='y'&&input.char(1)='x;') {
System.out.println(printy + " " + " "+ printx);
}
else if if (input.char(0)='z'&&input.char(1)='y;') {
System.out.println(printz + " " + " "+ printy);
}
}
}
}
![X
X
Zzzzz
Z
X X
X
X X
X X ZZZZZ
Z
Z](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd03390a9-7b5c-47c3-a36d-fabc9697d325%2F71b293b9-3b42-4eae-b6a0-e28b14af1d05%2Fk6pdjps_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)