In addition to @portugalcoin's comment:
- You are tackling a very basic aspect of Java, an if-else implementation. What value does this add?
- Moreover, you are explaining the code with a different code than the one you had written. Your code: Scanner barang=new Scanner (System.in); Your explanation: Scanner Scanner item = new Scanner (System.in);... I am concerned you might be copying code from elsewhere. Be careful as plagiarism is a serious offense and could lead to being banned from receiving Utopian reviews.
Chat with us on Discord.
[utopian-moderator]Need help? Write a ticket on https://support.utopian.io/.