Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By JosAH

Thread: I am beginning to get the basics of Java...

  1. #1
    OxigEN. is offline Member
    Join Date
    Nov 2014
    Posts
    28
    Rep Power
    0

    Default I am beginning to get the basics of Java...

    Well, hello.

    This is my first post on this forums and I have a question to begin with.
    I have started to learn Java about three days ago and I am already making alot of progress in my opinion (Already made calculator, usage of math functions, deciding if stuff is true or false using random numbers, etc) and I don't really have any questions right now regarding coding or anything like that because I am still in a learning period.
    Althought I have a question regarding the language itself, I don't quite understand what does object-oriented language means, in the coding itself (I am not sure, I am still new) it's something like this I guess (When using the scanner import) Scanner getInput = new Scanner(System.in); -- I assume it's something like that.

    So, bassicly I'd like to get an explanation to what is actually object-oriented language, I have already searched it on wikipedia and I didn't quite undrstand it, I am hoping to get an easier to understand answer here.

    Thanks :D

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: I am beginning to get the basics of Java...

    The wiki requires a lot of additional reading indeed.

    What about the official Java tutorials? Are those more clear to you?

    https://docs.oracle.com/javase/tutor...pts/index.html

    IMO to truly get a feel for what it is, you'd also have to dig back into history and learn what it isn't. As in it is not procedural programming which is what popular classic languages such as C and Pascal are based around.

    OOP emphasizes designing ("modelling") your code to mimic more the real world. If you build a financial application you'll likely have to build in functionality to create and print invoices - thus you can be darned sure you will be creating Invoice objects in your code and such an invoice might be composed of say a Recipient or a Client which has an Address that represents a MailingAddress; it will also have a collection of Booking objects with Bookinglines; each of these objects will also have specific properties attached to them; a bookingline will likely have a numeric amount and a currency for example. A client will have a name.

    As a simple to envision example that might give an idea what it is all about. To truly explain it, I'd have to type up a chapter of a book here - you're better off just reading about it in your own study book ;)
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,143
    Rep Power
    15

    Default Re: I am beginning to get the basics of Java...

    Shameless self-promotion: I wrote a little tutorial on OOP here: Tutorials - Static Void Games
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  4. #4
    OxigEN. is offline Member
    Join Date
    Nov 2014
    Posts
    28
    Rep Power
    0

    Default Re: I am beginning to get the basics of Java...

    Thanks, more information that you think I can find helpful with my current question, please post it, it'll be greatly appreciated.

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: I am beginning to get the basics of Java...

    Structured programming is (or was) all about how and what a computer should do to get a job done. Object Oriented programming is also about who or what should do (parts of) the job. It is a bit animated, i.e. things like Invoices seem to be living 'things' and BankAccounts seems to be able to do things on their own ... they have a 'role' and a 'responsibilty' and your Object Oriented program manages them all ...

    kind regards,

    Jos
    gimbal2 likes this.
    Build a wall around Donald Trump; I'll pay for it.

  6. #6
    bitesizejava is offline Member
    Join Date
    Nov 2014
    Location
    Spain
    Posts
    2
    Rep Power
    0

    Default Re: I am beginning to get the basics of Java...

    I'm also new to Java (I've been studying for the last couple of months) and I can tell you the object-oriented concept needs a bit of time. Once you learn some more about the language you will start figuring out what it is and what are the differences with other languages :)

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: I am beginning to get the basics of Java...

    Yes but you learned a bit of C first, which gives you an edge and an actual language to compare to ;) Not many people follow your learning path anymore and thus must bare the responsibility of having to learn programming theory, computer science and object oriented design basically all at once. Not a problem in itself, but most people impose an impossible time pressure on it and thus turn their learning path into a frustrating chaos.

    In other words: in my opinion you did quite right to do some C first.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    bitesizejava is offline Member
    Join Date
    Nov 2014
    Location
    Spain
    Posts
    2
    Rep Power
    0

    Default Re: I am beginning to get the basics of Java...

    It's great to read that! I learned C in college and I remember a lot of people complaining about it but I actually liked it :) You are right I feel I have a lot of the work done with basic concepts but still all the object-oriented thing is a difficult idea.

  9. #9
    omidroozmand is offline Omid Roozmand
    Join Date
    Nov 2014
    Posts
    3
    Rep Power
    0

    Default Re: I am beginning to get the basics of Java...

    There are many tutorials on internet about object oriented programming. However, according to my experience, the best way to really understand the OOP is to start with a structured programming such as pascal or C. It helps you to deal with difficulties of designing and programming of a project with structured languages. Then you may start learning OO and designing the same project with OO. I think this is a good way of learning OO. Then, when you learnt OO, you may learn programming based on OO....

  10. #10
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: I am beginning to get the basics of Java...

    Quote Originally Posted by omidroozmand View Post
    the best way to really understand the OOP is to start with a structured programming such as pascal or C. It helps you to deal with difficulties of designing and programming of a project with structured languages.
    Java is a structured programming language. It uses for/while loops, and various other control statements to structure the flow of the program (eliminating the old goto statement and its variants (e.g. computed goto)). There is nothing to prevent someone from employing only static methods to do some functional programming. But that person would be limited in what they could accomplish. Of course, Java does not have "structures" like C does using the struct keyword. But that is a different thing altogether.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  11. #11
    omidroozmand is offline Omid Roozmand
    Join Date
    Nov 2014
    Posts
    3
    Rep Power
    0

    Default Re: I am beginning to get the basics of Java...

    Quote Originally Posted by jim829 View Post
    Java is a structured programming language. It uses for/while loops, and various other control statements to structure the flow of the program (eliminating the old goto statement and its variants (e.g. computed goto)). There is nothing to prevent someone from employing only static methods to do some functional programming. But that person would be limited in what they could accomplish. Of course, Java does not have "structures" like C does using the struct keyword. But that is a different thing altogether.

    Regards,
    Jim
    I did not mean that java is not a structured programming language. Actually I meant procedural language. I meant to better understand the drawbacks of these languages in designing and programming a project in comparison to the capability of OO in software development. A programmer should know that how OO helps him/her to better design and program, something that s/he was not able to do with a 'procedural' language!
    Last edited by omidroozmand; 11-21-2014 at 07:03 AM.

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: I am beginning to get the basics of Java...

    Using structured programming (or even procedural programming) only tends to result in a few methods (probably static) that are large; e.g. all the code is in main( ... ) that goes on and on and on ad nauseam, while OO would've resulted in a lot of ridiculously small methods that are each easier to understand; and that's where the problem lies: trying to understand one big blob of code, is difficult, but trying to understand a myriad of small methods is also a nasty task ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Beginning Java
    By Xilver in forum New To Java
    Replies: 6
    Last Post: 09-05-2014, 01:37 PM
  2. Java EE Beginning
    By Thomas in forum New To Java
    Replies: 4
    Last Post: 05-20-2013, 10:31 PM
  3. Beginning advanced java
    By vinci123 in forum Advanced Java
    Replies: 7
    Last Post: 09-14-2011, 08:25 AM
  4. Beginning Programming with Java For Dummies
    By jon01 in forum New To Java
    Replies: 4
    Last Post: 02-16-2009, 09:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •