Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

View RSS Feed

All Blog Entries

  1. For Loops

    The For Loop is probably the most common loop used in any programming language. Here's how it works in Java.

    class Class1{
    	public static void main(String args[]){
    		for(int counter=1; counter<=10; counter++){
    			System.out.println(counter);
    		}
    	}
    }

    The For Loop takes three arguments: where you want it to start, where you want it to end, and how you'd like to increment the counter. Take a look at the below ...
    Categories
    Uncategorized
  2. Simple Averaging Program

    What this application does is collects a number of inputs from the user via a scanner. These inputs are numbers. They are then averaged and the average is outputted. Pretty simple stuff.

    import java.util.Scanner;
    class Class1{
    	public static void main(String args[]){
    		Scanner input = new Scanner(System.in);
    		int total = 0;
    		int grade;
    		int average;
    		int counter = 0;
    		int numGrades = 10;
     
    		System.out.println("Please
    ...
    Categories
    Uncategorized
  3. Scanners

    I forgot to write about the scanner, so I'm going to do that now.

    Basically, a scanner is used to get information from the user. At this stage, the scanner will be used only to gather information from the keyboard. Here's how it works.

    import java.util.Scanner;
    class Class1{
    	public static void main(String args[]){
    		Scanner input = new Scanner(System.in);
    		System.out.println("Enter some text:");
    		System.out.println("The
    ...
    Categories
    Uncategorized
  4. JD1's Personal Development Blog

    Quote Originally Posted by KevinWorkman View Post
    Again, just to nitpick, the tertiary (conditional) operator isn't exactly like an if statement- it simply chooses between two values. You can't, for example, do this:


    boolean blue = true;
    blue ? System.out.println("blue") : System.out.println("red");

    Instead, you'd have to do something like this:

    boolean blue = true;
    String print = blue ? "blue" : "red";
    System.out.println(print);
    Categories
    Uncategorized
  5. 20 Tutorials Summarised!

    Well, I've finally finished watching and summarising (in this thread) the first twenty tutorials of TheNewBoston's Java Programming Tutorial series. I've previously watched all 87 tutorials, but never summarised any of them to the point that the information stuck in my head long enough for me to retain.

    I plan on doing the same sort of thing for the next 67 tutorials and then into the Intermediate Java tutorials.

    Thank you to everyone who has helped me out along the ...
    Categories
    Uncategorized
Page 5 of 14 FirstFirst ... 34567 ... LastLast