Page 1 of 2 12 LastLast
Results 1 to 16 of 17

Thread: Questions about Java

  1. #1
    Panzer Division Marduk PanzerKnight's Avatar
    Join Date
    Jul 2003
    Location
    Surrey
    Posts
    555
    Thanks
    6
    Thanked
    0 times in 0 posts

    Questions about Java

    hey,

    been trying to teach myself java and just wanted to ask a question. I'm using Borland Jbuilder and i created a class. Now, i got this book and and just started working on something called strings. My code looks like this:

    public class Testing {
    String getString()
    {
    return "This is a string";
    }


    }

    Basically just wondering what the purpose of the () is for? Also, what the ; at the end of return is for? lol and what the whole idea behind all the {'s

    Thanks for any help!

  2. #2
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,276
    Thanks
    292
    Thanked
    837 times in 473 posts
    I don't do java, but I can probably tell you anyway.

    A string is basically just a series of characters strung together, hence the name.

    The () could contain a variable of something that can be passed into more complex functions... you'll learn about those as you progress. The ; signifies the end of the statement, it's a bit like using a full stop to signify the end of a sentence. The {}'s are used to contain things. So anything between the first { and the last } are part of public class Testing...

    Like I said, I don't do Java, but I do some PHP, VB and Pascal, so hopefully I'm on the right track there...
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  3. #3
    Panzer Division Marduk PanzerKnight's Avatar
    Join Date
    Jul 2003
    Location
    Surrey
    Posts
    555
    Thanks
    6
    Thanked
    0 times in 0 posts
    ah ok, thanks for clarifying those point. I borrowed some books off a mate but they seemed designed for ppl who have experience with programming already. Prolly will hit amazon in a bit

    cheers mate

  4. #4
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,276
    Thanks
    292
    Thanked
    837 times in 473 posts
    Yeah, if I hadn't done some programming I'd be thinking the same as you.
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  5. #5
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    java for students, third edition, Douglas Bell & Mike Parr ISBN 0130323772 prentice hall
    To err is human. To really foul things up ... you need a computer.

  6. #6
    Registered+
    Join Date
    Jul 2004
    Posts
    37
    Thanks
    0
    Thanked
    0 times in 0 posts
    I use java a fair bit currently doing my MSC project using Servlets (java for the web), Kez is correct regarding what the ( ) , ; and { mean. As far as books the most widely used Java books are the Java: How to Program series from Deitel and Deitel, which have never let me down, but I’ve not got the latest edition.

  7. #7
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    i concurr on deitel & deitel, 3rd ed does me.

  8. #8
    Panzer Division Marduk PanzerKnight's Avatar
    Join Date
    Jul 2003
    Location
    Surrey
    Posts
    555
    Thanks
    6
    Thanked
    0 times in 0 posts
    thnaks will check them both out
    how do you think they are for someone who has never programmed before in their life?
    Last edited by PanzerKnight; 26-07-2004 at 09:54 PM.

  9. #9
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,276
    Thanks
    292
    Thanked
    837 times in 473 posts
    I wouldn't say Java is the best place to start for programming. Somebody who has programmed in it might correct me on that though...
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  10. #10
    Registered+
    Join Date
    Jul 2004
    Posts
    37
    Thanks
    0
    Thanked
    0 times in 0 posts
    I pretty much learned java using the Deitel and Deitel book and the sun java site, I had only done some visual basic before, if you can could call that programming.

    Java is easier than C / C++, no memory management and a massive class library but the syntax is pretty much the same.

  11. #11
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    java is an excelent beginner language, if you want to start on object orientation & move backwards into older systems (structured, pointers, etc).

  12. #12
    Panzer Division Marduk PanzerKnight's Avatar
    Join Date
    Jul 2003
    Location
    Surrey
    Posts
    555
    Thanks
    6
    Thanked
    0 times in 0 posts
    Quote Originally Posted by Kez
    I wouldn't say Java is the best place to start for programming. Somebody who has programmed in it might correct me on that though...
    ah starting java next year so havent got a choice though
    shalll check out the deitel book, think i seen it in waterstones

  13. #13
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    java is easier to learn than C, C++ because of the memory managment as already stated.

    A few initial thoughts of Java <- just did a crappy course on programming language comparison.

    It automatically manages arrays to stop things buggering random parts of memory.
    It garbage collects to remove random crap from memory.
    It is as cross platform as it can be <- with performance issues.
    It is highly orthogonal in that it has a few ways to do things and if you know them then they scale up. so we can do things like new Class(new otherclass()) etc and this is equivalent to splitting things up etc.. some other benefits.
    It is really THE language to use where computers have decent CPUs and your users wont be recompiling.

    There is more than this but I am boring myself. suffice to say there was about 50 years of solid programming language creation and most of the issues were designed to be removed from it and the tradeoffs are really more balanced than anything else i have programmed in. i felt vb was too simple for my liking. i felt tricked...

  14. #14
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    recent java versions are as fast as c++ in many mathematical operations. it also has a heavy server following, as serverlets are extremely powerful.

  15. #15
    Panzer Division Marduk PanzerKnight's Avatar
    Join Date
    Jul 2003
    Location
    Surrey
    Posts
    555
    Thanks
    6
    Thanked
    0 times in 0 posts
    recent jave...u mean like java 2?
    Got the deitel book, explains everything very nicely
    still reading all the background info at the mo

  16. #16
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    j2se 1.5 ideally. it's much faster than 1.4. still beta though

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Java Problems
    By Applecrusher in forum Software
    Replies: 4
    Last Post: 27-04-2004, 01:12 PM
  2. few questions
    By serlex in forum PC Hardware and Components
    Replies: 6
    Last Post: 06-02-2004, 04:16 PM
  3. Shuttle 101 (that's the number of questions!)
    By goof in forum PC Hardware and Components
    Replies: 11
    Last Post: 17-01-2004, 09:58 PM
  4. Java
    By Jonny M in forum Software
    Replies: 8
    Last Post: 24-12-2003, 02:33 PM
  5. Java vs .NET
    By DaBeeeenster in forum Software
    Replies: 2
    Last Post: 11-09-2003, 02:47 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
  •