Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to print the below in java?
* *
* *
*
* *
* *

Answers were Sorted based on User's Feedback



how to print the below in java? * * * * ..

Answer / ganesh slv

/**
* Printing Stars - 24.03.10
* @author Ganesh
*/

public class Star {

/**
* Please Send me Your Comment - slvganesh.java@gmail.com
*/

public static void main (String arg[]) {

int n = 6;
for (int i=0, j=n; i<=n; i++,j--) {
for (int k=0; k<=n; k++) {

if (i==k || j==k)
System.out.print ("*");
else
System.out.print (" ");
}
System.out.println ();
}
} // Main
} // Class

Is This Answer Correct ?    17 Yes 1 No

how to print the below in java? * * * * ..

Answer / kickme

public static void main (String arg[]) {
System.out.println(" * * ");
System.out.println(" * * ");
System.out.println(" * ");
System.out.println(" * * ");
System.out.println(" * * ");
}

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is size of int in java?

0 Answers  


java can provide security ,how can provide?

8 Answers   Aspire, BNP Paribas, Genpact, IBM,


How many bytes are a float?

0 Answers  


What is thread count in java?

0 Answers  


How does compareto method work?

0 Answers  


What are accessor methods in java?

0 Answers  


Explain the importance of finalize() method.

0 Answers  


What are the 5 types of research methods?

0 Answers  


What is use of super keyword?

0 Answers  


What is binary search in java?

0 Answers  


when,where and how to use abstract class and interface

2 Answers  


Can you override a final method?

0 Answers  


Categories