Author Topic: Looking for info...about java  (Read 5051 times)

0 Members and 1 Guest are viewing this topic.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Looking for info...about java
« on: March 07, 2011, 04:13:43 pm »
What kind of language is Java? I've heard various phrases tossed around, like "object oriented," etc. And, as a low-level programmer highly proficient in something like Axe, would it be easy or hard to pick up?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Looking for info...about java
« Reply #1 on: March 07, 2011, 04:21:47 pm »
What kind of language is Java? I've heard various phrases tossed around, like "object oriented," etc. And, as a low-level programmer highly proficient in something like Axe, would it be easy or hard to pick up?

It's easy to pick up if you have experience in other OOP languages.

Object Oriented Programming is like:

Code: [Select]
str1 = "hey"
a = str1.length()
#a = 3
The upper code is python, but OOP is when you access object properties.

A property of a string can be its length, it's number of words, it's position (GUI), it's size (GUI).

Objects have an enormous number of properties and methods.

Take a look at this Java method:

Code: [Select]
JButton button = new JButton(); //This creates a button
button.setVisible(true); // setVisible() is a method, and I set it to true in order to show the button


Explaining OOP is hard, here's a Python example:


Code: [Select]
a = "hello"
print len(a)  # This is non-OOP
print a.__length__  #This is OOP
This last example is what made me understand OOP, I'll never forget it.

If you have experience in Python (and I know you do), you'll find Java more OOPy and easier to handle when it comes to GUI.

The inheritance is DAMN hard to get, but when you get it, you'll like it.
« Last Edit: March 07, 2011, 04:22:18 pm by Scout »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Looking for info...about java
« Reply #2 on: March 07, 2011, 04:24:20 pm »
I have no experience with Python or any other higer-level language save TI-BASIC XD

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Looking for info...about java
« Reply #3 on: March 07, 2011, 04:25:30 pm »
I used this textbook to learn Java, and using it has made me proficient enough to do good on the AP Computer Science Test:

http://math.hws.edu/javanotes6/


Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Looking for info...about java
« Reply #4 on: March 07, 2011, 04:27:34 pm »
I have no experience with Python or any other higer-level language save TI-BASIC XD

OOOh, I thought you made TI_Convert (It was Michael Lee it seems)

Ok, Java is higher than Axe, but not as high as TI-Basic (you can shut down the computer).

Wow, but at least take a look at this example if you wanna know what OOP is:

Code: [Select]
a = "Hello World"     #this makes the variable a be "Hello World", a STRING
print len(a)             # this returns (as in Disp ) the length of a
print a.__length__     # this makes the same thing as above, but it accesses a property of a, its length, Object-Oriented Programming
Also, this example is Python, not Java, in Java everything pretty much is OOP.

If you wanna learn Java, try this:

http://leepoint.net/JavaBasics/index.html

After getting enough, move on to this:

http://leepoint.net/notes-java/index.html

But starting with Java after TI-Basic/Axe is gonna be hard :) But you're an awesome Axe programmer, I'm sure you can do it :)
« Last Edit: March 07, 2011, 04:28:49 pm by Scout »

Offline Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: Looking for info...about java
« Reply #5 on: March 07, 2011, 05:19:18 pm »
Java is a fairly simple language. As you learn more and more from/about it, I think you will really like OOP. It is a higher-level language that is extremely portable and can be used in a wide variety of applications. Plus it has a built-in garbage collector for memory management. Which means you will be pretty spoiled, because a lot of higher-level languages don't have that and if they do they aren't very good. Plus with a wide variety of tutorials and all the API's provided by Sun make it a great, language to pick up for a beginner.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Looking for info...about java
« Reply #6 on: March 07, 2011, 06:27:30 pm »
This. Object-oriented languages are amazing.
In addition to being simple, it also has more advanced features if you need them. It's not a bad language to know, not at all :D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Looking for info...about java
« Reply #7 on: March 07, 2011, 06:49:42 pm »
java's a pretty easy language to pick up. here i'll describe the basics of OOP:
OOP is Object Oriented Programming. to start, i'd suggest to just learn about classes, objects, methods, instance variables and constructors along with how they interact. a class can be thought of a blueprint to make an object. a class contains methods (subroutines), instance variables (like A-Z+theta, except user-defined) and constructors (a special type of method used to create an object). here's a short example, labeling the parts of a class:
Code: [Select]
class Enemy{
     private int xPos = 0; // this creates an integer instance variable "xPos" and sets it to 0
     private int yPos = 0; // because of the variables are "private", they cannot be accessed outside the class

     public Enemy(int x, int y){ //constructor. enemies have an x and y position as parameters
          xPos = x;
          yPos = y;
     }

     public int getX(){ //this is a method. it returns a type int, and has no parameters passed.
          return xPos;
     }
     public void setX(int x){ //another method, with a void return type.
          xPos = x;
     }
}

to make and manipulate a new Enemy object, you would do:
Code: [Select]
Enemy myEnemy = new Enemy(5, 10); //creates a new Enemy object called myEnemy
int x = myEnemy.getX(); //calls the method "getX()"
System.out.println(x); //prints 5
myEnemy.setX(200); // calls method "setX()"
System.out.println(myEnemy.getX()); // calls getX(), and prints the value (200)


Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Looking for info...about java
« Reply #8 on: March 07, 2011, 07:46:41 pm »
Java is awesome in that it's really, really consistent in everything. In other words, programs are object definitions and object definitions are programs, so you pretty much need to grasp OOP to understand Java (but once you get into Java, you'll start understanding OOP pretty easily). On the other hand, this can cause headaches too :D

In short, a class (object definition) is like a specification. A class defines a type of object, which could represent anything -- car, bank account, lobster, whatever. In essence, you're creating a new type of variable, with its own attributes and functions, which you can create instances of through other programs.




Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Looking for info...about java
« Reply #9 on: March 07, 2011, 08:21:12 pm »
I don't know much about Java (apart from the fact that it's highly object-oriented), but from my experience transitioning from TI-Basic and Axe to C++ and Python, I can say that OOP isn't as hard as people make it out to be (either that, or I never learned it properly :P) -- I found that using OOP in various projects turned out to be the best way to grok it.  Also, it's hard to get out of the habit of using global variables, but in OOP languages, globals are generally frowned on.

Really, I don't think you'll have a problem.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Looking for info...about java
« Reply #10 on: March 07, 2011, 08:37:29 pm »
I don't know much about Java (apart from the fact that it's highly object-oriented), but from my experience transitioning from TI-Basic and Axe to C++ and Python, I can say that OOP isn't as hard as people make it out to be (either that, or I never learned it properly :P) -- I found that using OOP in various projects turned out to be the best way to grok it.  Also, it's hard to get out of the habit of using global variables, but in OOP languages, globals are generally frowned on.

Really, I don't think you'll have a problem.

You won't. It just involves a different way of thinking about programs :)