| | |
A newbie needs help in Java ......
![]() |
•
•
Join Date: Jun 2005
Posts: 15
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
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.
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.
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.
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- Switch and Cases (Java)
- hi.. string compare (Java)
- Help needed (Game Development)
- java newbie (Java)
- File upload problems (PHP)
- some info (Java)
- new to web srevices (Java)
- newbie... Java load large picture :) Lit'l help plez (Java)
Other Threads in the Java Forum
- Previous Thread: Reading from a file to fill an array
- Next Thread: Reflection in Python
| Thread Tools | Search this Thread |
2dgraphics 3d @param affinetransform android api applet application arc arguments array arrays automation banking binary bluetooth byte chat chatprogramusingobjects class client code color compare component count database design detection eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide if_statement image input integer interface j2me java java.xls javadesktopapplications javaprojects jni jpanel julia keytool keyword linux list loop macintosh map method methods mobile netbeans newbie object os pong problem producer program programming project projectideas read recursion reference replaysolutions rim scanner server set size sms sort sql string swing terminal threads transforms tree ui unicode validation web windows






