944,131 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1765
  • Java RSS
Aug 3rd, 2005
0

A newbie needs help in Java ......

Expand Post »
I am new to Java & in my college we r directly being taught the applets. So i have a very simple set of questions since i have not done core Java.please answer them in relation to applets(I have a background in C/C++ also)-----
1) While calling inbuilt functions in Java we can write statements like these- obj_name.method_name() or method_name() or class_name.method_name() (I know this is used when the func is static, so plz tell which type of func are usually static in Applets) . When do we use each of these statements.
2) I am having a lot of problems in remembring which are uppercase/lower case letters in class and inbuilt method names.
Does a class name always start with a capital? And do all the words in function name except the first one start with capitals? I know for both these questions the answer is not always. So which classes & methods dont follow this rule.



Akshey
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
akshayabc is offline Offline
15 posts
since Jun 2005
Aug 3rd, 2005
0

Re: A newbie needs help in Java ......

The first question, where to usestatic methods in applets:

1) Not very often. It's not advisable for newcomers to start using static methods right away, because they're normally used in the wrong context. Static methods only share one object. If you have ten instances of one static method, they all share the same object.

2) You have your second question correct. You DON'T HAVE to do this, but it's good programming practice.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Aug 4th, 2005
0

Re: A newbie needs help in Java ......

1) not quite. Static methods don't share any object instance. Rather they don't have access to the object instances at all.

2) http://java.sun.com/docs/index.html see the coding conventions for what's the norm, and the language specs for what's required. Also check out the tutorial (it's not quite up to date but rather nice anyway). And of course the API docs which are vital to have and understand how to use.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Aug 4th, 2005
0

Re: A newbie needs help in Java ......

Quote originally posted by jwenting ...
1) not quite. Static methods don't share any object instance. Rather they don't have access to the object instances at all.
I swear I use to know this! I'm glad you're hear, or else I would be making people more dumb.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Reading from a file to fill an array
Next Thread in Java Forum Timeline: Reflection in Python





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC