Backward and Forward Asterisks
Hi, Have a happy Sunday. Today I'm going to explain, how to deal with asterisks problems. Just before the day, I've been attend the interview. Question: To print out Asterisk (*) in system console in specific order. ***** **** *** ** * This is backward asterisks, I'm failed to do that, because of less time, no test cases and unfortunate system freezes. Yeah, this is not accept by recruiters. It's very simple problem, I know. Anyway 15 minutes passes by. No clues. I'm going to give the answer by two ways here now. 1. Backward Asterisks 2. Forward Asterisks Solution: public class Asterisks{ /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner scan = new Scanner(System.in); System.out.println("Enter the number of rows : "); ...