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. 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
  2. Conditional Operators

    Basically, I like to look at Conditional Operators as a quick way of implementing an If Statement. That's really all they are. Take a look at this code.

    class Class1{
    	public static void main(String[] args){
    		int age =50;
    		System.out.println(age > 30 ? "You are quite old!" : "You are still young!");
    	}
    }

    You can see that we've initalised an integer with the value of 50. Our Conditional Operator ...
    Categories
    Uncategorized
  3. Constructors

    We can use a constructor to quickly initialise variables as soon as our object is created. If you haven't read the above post, please do - you will become familiar with the code we're using for these examples.

    Here's Class1.

    class Class1{
    	public static void main(String args[]){
    		Class2 class2Object = new Class2("Tony");
    		class2Object.outputName();
    	}
    }

    You can see what we've done here is ...
    Categories
    Uncategorized
  4. Many Methods & Instances

    This post goes over how we can use multiple methods in different classes. It's a very inefficient program we've written, but it's designed to show you exactly what each method does and how they relate to each other. Here's Class2, the guts of the application. I've included comments to show you what everything does.

    public class Class2 {
    	//New string
    	private String friendName;
    	/* This method is responsible for collecting the name
    	 * variable
    ...
    Categories
    Uncategorized
  5. Private Variables

    Private variables cannot be used over multiple classes. They are specific to the class in which they were created, hence the private part. You can declare a private variable by writing private before it, as seen below.

    private String devName;

    If the variable devName was in Class2, it would not be able to be used in Class1, since it is exclusive to its home class, if you will.
    Categories
    Uncategorized
Page 6 of 14 FirstFirst ... 45678 ... LastLast