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.


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

View RSS Feed

All Blog Entries


    You can make comments in your Java code in two ways, single line comments, and multiple line comments. Below is a single line comment.

    //This is a single line comment.

    And below is a multiple line comment.

    /*This is a multiple line comment.
    It can span over multiple lines.*/

    Comments are used to explain certain code to yourself and others that may be reading your code.
  2. I've Learned About A Few General Java/Programming Conventions

    First of all, thanks to the following members for helping me out thus far. I very much appreciate your time and effort and I've decided to take everything on board.

    First of all, KevinWorkman told me of the importance of implementing braces on all statements (If Statements, Switch Statements, etc) regardless of whether there's only one line's code after the condition. If you don't implement braces around these statements ...
  3. JD1's Personal Development Blog

    Quote Originally Posted by Norm View Post
    Some more comments on your coding style;
    Class names should start with uppercase letters:
    class class1{
    class Class1{

    Put some white space in the statement to make them easier to read:
    String name="Tony";
    String name = "Tony";
  4. Methods With Parameters

    Discussed in my last post was how we implement multiple classes and execute methods from within these classes via the main class. We can actually send variables from the main class into a method of the secondary class and then use those variables as desired. We do this through the use of parameters. Let me show you what I mean. Here's class2 and what it does.

    public class class2{
    	public void class2Method(String name){
    		System.out.println("Hello "+name);
  5. Multiple Classes

    In each Java application, you're going to have a series of classes containing various instructions for the compiler. Each class can be responsible for different actions or functionality of the program.

    Below is our first class, appropriately named class1.

    class class1{
    	public static void main(String args[]){
    		System.out.println("This code is executed via class1!")

    Let's say that class1 is responsible for a ...
Page 7 of 14 FirstFirst ... 56789 ... LastLast