Results 1 to 2 of 2
  1. #1
    sjicho is offline Member
    Join Date
    Oct 2012
    Rep Power

    Default How to post code


    import java.util.Scanner;

    public class Help {
    public static void main(String args[]) {
    Scanner scanner = new Scanner(;
    System.out.print("Please enter a number: ");
    int intNumber = scanner.nextInt();

    String strNumber = String.valueOf(intNumber);

    int intNumberOfSevens = 0;
    char chrComparison = '7';

    for(int i = 0;i < strNumber.length();i++) {
    char chrTemp = strNumber.charAt(i);
    if(chrComparison == chrTemp) {

    System.out.println("Number of seven's is : " + intNumberOfSevens);

    and my question is how do you print code like that on the forum

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: How to post code

    Removed from

    When you have a question, start your own thread. Don't hijack another poster's thread with an unrelated question.

    There are several links near the top of every forum page, did you try clicking around to see what you could discover about using the forum?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Code question. Where to post.
    By Tullamore in forum New To Java
    Replies: 6
    Last Post: 04-06-2012, 05:10 AM
  2. Replies: 3
    Last Post: 05-04-2009, 03:15 AM
  3. Please post your suggestions about this code
    By mathansj in forum Advanced Java
    Replies: 8
    Last Post: 02-15-2009, 04:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts