Pokemon Server Archive

Community Related => General Discussion => Topic started by: liquidfired on February 21, 2012, 04:38:07 am

Title: JAVA HELP
Post by: liquidfired on February 21, 2012, 04:38:07 am
Hey guys, I really want to get in AP Computer Science for my Sophomore year and I must know part of java combined with Algebra 2. I forgot most of my Java so if any of you guys can give some quick pointers and tips. I WOULD LOVE YOU FOREVER>
Title: Re: JAVA HELP
Post by: Paradox on February 21, 2012, 07:45:02 am
I'm in AP Computer science now as a sophmore. What do you need specific help with?
Title: Re: JAVA HELP
Post by: liquidfired on February 21, 2012, 08:45:48 am
I don't get the concept of modifiers
Title: Re: JAVA HELP
Post by: ArchieSalt on February 21, 2012, 12:19:02 pm
WTF is this. I feel so puny and unintelligent
Title: Re: JAVA HELP
Post by: Paradox on February 21, 2012, 08:02:32 pm
Well, modifiers is a really broad term. I'm assuming you mean access modifier. If so, modifiers are just a description of what things can access that data.. There's a bunch of them, but the key ones you need to know, from what I know, are:


public: Pretty obvious. All classes can access this piece of data.


EX: public int x;


private: Only things within the class can access this piece of data.


EX: private int x;


protected: Only things in the class and subclass (You know inheritance, right?) can access it. (BTW, this is VERY rarely used from what I know).


protected int x;


Those are for access. There are two other types of modifers that are important that describe a data's abilities. One is final and one is static.


Final: This is normally used for data, but can be used for classes. Anyways, it makes it so that whatever this code is can't be changed. Forever and ever and ever. So, you would want to use it when you want something uchangable, like:


final double pi=3.14;
(Pi never changes, so you want it final)


Static: This means that it can't be used by objects. This allows your code to be run without objects, because as you hopefully know Java is an OOP. So, if I want my code to work without objects, make it static. Like the famous:


public static void main(String[] args)
(This is the common method that is used at the start up of a program. The array in the parameters is used for when you need to pass an array into the main method, mainly used if you make a program in notepad and want to run into in command prompt. But who does that? :P)


Hope this didn't confuse you. I'll happily explain anything in detail, feel free to ask. There's a lot of information I left out, but this is just the bare basics.
Title: Re: JAVA HELP
Post by: Paradox on February 21, 2012, 08:05:01 pm
so if any of you guys can give some quick pointers and tips.


I see what you did there, sneaky boy :P Or maybe that was on accident, I don't know lol. Anyways, pointers are for C++, here in Java land we don't need to worry about that so much!


Title: Re: JAVA HELP
Post by: Vitto on February 21, 2012, 08:18:33 pm
Dammit para, what is this?!?
Title: Re: JAVA HELP
Post by: Paradox on February 21, 2012, 08:42:17 pm
Dammit para, what is this?!?


The basics of programming lol. I have a slight obsession with Java.
Title: Re: JAVA HELP
Post by: 1cec0ld on February 22, 2012, 01:32:36 am
Anyways, pointers are for C++, here in Java land we don't need to worry about that so much!

Are they now? Maybe if I can pass this damn CS 135 class I'll learn exactly what they are... >:-(
Title: Re: JAVA HELP
Post by: Paradox on February 22, 2012, 07:30:06 pm
Anyways, pointers are for C++, here in Java land we don't need to worry about that so much!

Are they now? Maybe if I can pass this damn CS 135 class I'll learn exactly what they are... >:-(


Well, my post was more suppose to be a joke more than anything. See, in Java, the implementation of how pointers are and where they point to memory is hidden from the programmer because that's how the developers did it. So we are never able to see it, so you don't worry about looking at it. In C++ and many other lower level languages, you are given the ability to see the pointers. Which can be helpful if you're trying to understand where memory is being stored, ESPECIALLY for data structures.
Title: Re: JAVA HELP
Post by: Vitto on February 23, 2012, 02:22:15 pm
Anyways, pointers are for C++, here in Java land we don't need to worry about that so much!

Are they now? Maybe if I can pass this damn CS 135 class I'll learn exactly what they are... >:-(


Well, my post was more suppose to be a joke more than anything. See, in Java, the implementation of how...
That's when I wasnt able to read it anymore.
Title: Re: JAVA HELP
Post by: ArchieSalt on March 14, 2012, 04:28:23 am
I couldnt read it way before that.