Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-10-2009, 03:07 AM   PM User | #1
jdfskitz
New Coder

 
Join Date: Aug 2009
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
jdfskitz is an unknown quantity at this point
Where Do I go ? Experts Help?

Please dont post any stupid responses
PLEASE!!!

i already know the
retarded hello world program...

i almost got the jframe down.. its something like this im pretty sure

Quote:
import javax.swing.*;

int main() {

public static void frame() {

JFrame frame = new JFrame("Frame");
JFrame.setLabel("Label");
frame.setPrefferedWidth("480, 640");
frame.setVisible(True);



public static void main(String[]Args) {

}
});
}
I remember its something around there.. but anyways. thats to complicated right now...

I want to start making my own stuff.. but not with a frame. not in game style.. no pictures.. i need to learn about certain variables and certain object oriented programming...

I want to learn how to make stuff on my own in a word number style based game..
and then work my way up

(And Yes.. i did the stupid hello world thing)
Quote:
package main;

int main() {

public static void(String[] Args) {

echo.system.out.println("hello world");
return:0;
}
}
I would like it . if someone posted exact spot where i should go now.. cause that is all that i have done...

I am pretty good with html and css... But I want to do something actually Im Tired of this!!

Please Post a spot

a program example for me to make

a tutorial

a program

an idea

or a list of variables or w/e commands and stuff... I really want to learn Java
But Nobody is working with me.. a few times on my post someone tried to help me but it didn't work. and then someone posted a stupid response and ended the conversation by saying something compared to Deal With It You Cant Do It!

And Those just piss me off

Do Not..(Repeat(do Not Post Deal With it you do not have the patience to learn java.. Cause there are people with adhd who have learned java..
so shut the f*** up dumba***s

*Srry About that.. that is just one of my pet peeves.. so please help? IM BEGGING!!!


I am 15 live in Idaho and i want to learn Java (or any kind of coding that is not flash or jass or python) and my email address is jdfskitz@yahoo.com

eather post or email me please ?
jdfskitz is offline   Reply With Quote
Old 09-10-2009, 03:37 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
The first thing to note is that Java is Object Oriented. Since it is, there is no entrance to the program like there is in C (similar to what you have here). So, the first thing to worry about is the definition of a class opening.
So this:
Code:
int main(int argc, char **argv)
{
    // Do stuff here
}
Doesn't exist in java. So instead, we write a class to be our main entrance location. Lets say its a Bank. This is where you're static main call goes (yes, its still called main, but you get to choose which class' main will handle the entry point):
Code:
public class Bank
{
    public static void main(String[] args)
    {
        // Stuff here
    }
}
At least one class needs to implement a main method for you're program to execute.

The first thing to learn is the difference between a class member / method and an object member / method. This is identified with the static keyword. This means that you use it in the context of a class, not as an object:
Code:
public class Account
{
    public static double dMaxWithdrawl;
    public double dBalance;
}
// Used as:
Account a = new Account();
System.out.println(a.dBalance); // Print 'this' account's balance
System.out.println(Account.dMaxWithdrawl); // Print the Account class' maximum withdrawl amount
Next, scope. Public, private, protected, and I believe its java that includes package. Public - Anything can access, private only this class (or instance) can use this, protected - Only this class and its children can access this.

Next, datatypes, probably the most important part of programming. Indicates the size of the variable in question, integer = 32bits (on 32 bit machine), char = 8 bits, etc. A class creates a new datatype, so the Account datatype is kind of like a struct representing in this case 128bits in size (2 x 64 bits where 64 bits = sizeof(double)). Datatypes are required in java to assign new variables and return types for methods.

Next is object handling, creating you're class to actually represent data in an individual context. This is really the key component to object oriented programming.

IO handling can go anytime between start and end. I would recommend advanced IO for after object handling is covered, with the exception of the System.out commands, and perhaps the Scanner class for input. These are kind of needed even in a static context so you can see what you're doing (especially if you're reluctant to use the debug tools which I find a lot of my students struggle with - this is you're best friend btw).

Collections are next, necessary to handle lists of data. This includes array's even though they are primitive (and as such not a typeof collection).

Lastly is a gui. Well built software will work the same in both a non-graphical and graphical interface, though the graphical version is easier (point and click versus display and choose entry). GUI's should be built in a way that they interact with you're program the same way you're command line interface should. I'm a fan of the bottom - up programming style.

Tutorials from Sun, these are probably the best you'll find on the net, though you may need to search for some clarification: http://java.sun.com/docs/books/tutorial/

If you're struggling with datatypes and return values (including overloading), you should consider using PHP as you're starting point. The object core is very similar to java, but PHP is loosly cast (meaning we don't care about our datatypes, it assumes its datatype from the context its in), and we also don't care about return or parameter types. This helps aspiring programmers, though I do recommend you don't forget that most languages enforce typecasting of you're variables and to keep it in mind when you're programming (this function will return an 'int' value, even though we can't program it in a way to enforce it).

I hope that helps, keep the sun site bookmarked, you'll be visiting those tutorials far more often than you think.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
jdfskitz (09-10-2009)
Old 09-10-2009, 03:50 AM   PM User | #3
jdfskitz
New Coder

 
Join Date: Aug 2009
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
jdfskitz is an unknown quantity at this point
ive tried php.. know one helps me there lol

I used to own a world of warcraft private server..

Shh dun tell anyone . lol

i know the stuff like

$db=dbname
$user=root
$password=password

but simple stuff like that.. But anyways.. i will try to read on the javatm tutorials

Thank You For The Tips. Im Still Looking for more if people want to post lol

But thankyou .. that was very generous.. +rep
jdfskitz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:36 PM.


Advertisement
Log in to turn off these ads.