Author Topic: JAVA HELP  (Read 5566 times)

liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
JAVA HELP
« 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>

Ad...

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: JAVA HELP
« Reply #1 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?

liquidfired

  • Dragon Tamer
  • Raiding Silph Co.
  • *****
  • Posts: 823
  • Friendliness: -4
  • Unregistered Member (Error 114: Needs Activation)
    • Liquidfired's Channel of Awesomeness
Re: JAVA HELP
« Reply #2 on: February 21, 2012, 08:45:48 am »
I don't get the concept of modifiers

ArchieSalt

  • Professor Assistant
  • Spelunking in Seafoam Islands
  • ****
  • Posts: 2365
  • Friendliness: 25
  • Registered User
Re: JAVA HELP
« Reply #3 on: February 21, 2012, 12:19:02 pm »
WTF is this. I feel so puny and unintelligent

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: JAVA HELP
« Reply #4 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.

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: JAVA HELP
« Reply #5 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!



Vitto

  • PokeFan
  • Fighting Sabrina
  • *
  • Posts: 1044
  • Friendliness: 16
  • PWNZOR 3000
Re: JAVA HELP
« Reply #6 on: February 21, 2012, 08:18:33 pm »
Dammit para, what is this?!?
[url

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: JAVA HELP
« Reply #7 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.

1cec0ld

  • Frozen Hearted Admin
  • Professor
  • Fighting Blaine
  • *****
  • Posts: 3084
  • Friendliness: 94
  • Who am I to judge others?
  • Pokemon Team: Typhlosion, Espeon, Aerodactyl, Glalie, Jolteon, Mew the HM Slave
Re: JAVA HELP
« Reply #8 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... >:-(

Paradox

  • Professor
  • Fighting Giovanni
  • *****
  • Posts: 966
  • Friendliness: 39
  • Registered User
Re: JAVA HELP
« Reply #9 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.

Vitto

  • PokeFan
  • Fighting Sabrina
  • *
  • Posts: 1044
  • Friendliness: 16
  • PWNZOR 3000
Re: JAVA HELP
« Reply #10 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.
[url

ArchieSalt

  • Professor Assistant
  • Spelunking in Seafoam Islands
  • ****
  • Posts: 2365
  • Friendliness: 25
  • Registered User
Re: JAVA HELP
« Reply #11 on: March 14, 2012, 04:28:23 am »
I couldnt read it way before that.