How to improve my quality of given code?

import java.util.Scanner; class WordSearch{ public static void main(String[]args) { Scanner value=new Scanner(System.in); String a="Shivakumar is great"; System.out.println("Enter a word for find out:"); String b=value.nextLine(); String[] arrayvalue=a.split(" "); for(String c:arrayvalue) { if(b.equals(c)) { System.out.print(b);
} else{ System.out.println("Not"); }
} } }
3 Replies
JavaBot
JavaBot3d ago
This post has been reserved for your question.
Hey @Shivakumar R! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot3d ago
Please format your code to make it more readable. For java, it should look like this:
​`​`​`​java
public void foo() {

}
​`​`​`​
​`​`​`​java
public void foo() {

}
​`​`​`​
JavaBot
JavaBot3d ago
Post Closed
This post has been closed by <@1338078366926110720>.

Did you find this page helpful?