Jump to content

Search the Community

Showing results for tags 'java'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • New Member at General Forum?
    • Welcome Lounge
    • General Forum Announcements
    • Suggestions and Feedback
  • The General Forums
    • General Discussions
    • News Hub
    • Gamers Den
    • Sports & Entertainment
    • Techno Geeks Unite
    • The Marketplace

Blogs

There are no results to display.

Calendars

  • Community Calendar
  • Default Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Gender


Interests


Occupation


Xbox Live Gamertag

Found 3 results

  1. Hello everyone, Dan here to give a few resources that can help you not only learn java, but pick up some tricks to better programming. If you feel like you have a great resource to contribute, then please let me know by posting here or in a PM; I'll gladly add it to this list with recognition to the supporter. Now, for beginner java programmers, I suggest the following: Java trail - this is where I began my learning. It is supported by Oracle, the creators of Java, and is well maintained. It provides a great start at the "Trails covering the basics" section, and it also covers advanced topics like JNDI, custom networking, and advanced graphics. Java beginner - Now this website was created with the beginner in mind, It gives a good introduction to Java and it's features, as well as providing good learning aid. Java 6 documentation (javadoc JDK v.6) - This web page contains the java documentation of all the classes. It does not implicitly tell you how it works, it just explains the methods and the class' purpose. Use this if you're trying to figure out how that constructor works, or if you wanna learn the secret stuff of classes. A lot of people will se me using this, as knowing the methods is half the battle in java. This reference is for all levels of learning, and is included in many IDE's such as Netbeans. For the more advanced users, may I suggest some links, such as: Killer Game programming in Java - As the title says, it's all about java game programming. Gives information as to logic, design, and implementation. Java Performance - This happens to be one of my favorite articles. It touches down on may performance issues that could arise in a given Java program, and offers alternatives to increase overall performance. I will be submitting tools and programs to aid in your Java developing soon, so stay tuned!
  2. I'mma be laying down some java chapters, teaching you what you need to know. Since I'm studying for my Sun Developer and Programmer certificates, I'm learning some great shit. I'm going to teach you some of what I learn, by sharing some of my notes with you. I am not going to release any of Sun's study software, but I'll teach with the open-source mentality that they support. First thing you need even before I start is some of the terms you need to know. I'm not pushover, so I expect you to know some stuff coming in. For those that don't understand some of the terms I use, refer to this page, as I'll add terms you might not know. Class - A template that describes the kinds of state and behavior of objects of its type support Object - Every time the JVM sees the "new" keyword, it creates an "object" out of that class. This is considered an instance of a class, and this object has its own state, and behaviors based on the class template. State (instance variables) - Every object (instance of a given class) has its own set of instance variables defined in it. These var Behavior (methods) - When you create a class, you also create "methods" for that class. Basically, these methods are the grunt work, or the logic of your class. It is these behaviors that you call on in order to manipulate data and execute algorithms. You'll get more definitions as I see you needing them. For now, familiarize yourself with these.
  3. So I have been looking into different ways to optimize and tune my code, when I ran into an article about strings. Now there are two types of objects in java, mutable objects, and immutable object; rather, changeable and unchangeable objects. Unfortunately, a String is among those immutable objects. It cannot change once it has been created. Now you say, "Well, how is that possible? It's easy to set a String to a new value!" Of course that it is easy, but that is because the String class handles all the low level operations to 'modify' the String. For example, let's say we have a simple class that takes a name input import java.io.Serializable; import java.util.Scanner; public class RegisterUser implements Serializable { private static transient Scanner iReader; private static transient boolean nameOK = false; private static String username = null; public static void main (String args[]) { println("Hello, Welcome to the new user registration."); println("Fortunately, all we need at this point is your name."); iReader = new Scanner(System.in); while (!nameOK) { println("If you please, what is your first name?"); username = formatCase(iReader.nextLine()); println("Is " +username+ " correct? if it is, please enter Y"); if (scanner.nextLine().toString().equalsIgnoreCase("y")) nameOK = true; } nameOK = false; while (!nameOK) { println("Thank you. Now, what is your last name?"); String lastName = formatCase(iReader.nextLine()); println("Is " +lastName+ " spelled right? if it is, please enter Y"); if (scanner.nextLine().toString().equalsIgnoreCase("y")) { nameOK = true; username += " " + lastName; } } println("Thank you very much, " +username+ ", your username has successfully been registered."); } static String formatCase(String s) { return (s.length()>0) ? Character.toUpperCase(s.charAt(0))+s.substring(1) : s; } static void println(String s) { System.out.println(s); } } This class, from our point of view, is simple, and gets the job done quick. However, if we were to modify this to serve a large number of users concurrently, we'd run into a problem. When we do things, such as modify a string, we are not actually modifying it. We are creating two objects to replace it. When we used the line:
×
×
  • Create New...