Anyone know Java?

TheSomeone

Newbie
Joined
Dec 24, 2004
Messages
2,186
Reaction score
0
What are static methods exactly? And unqualified names? And what's the default package?

AUGH! I"M DYING.
 
static methods are ones that you can only have once in your whole class.. like if you would use a constant you didnt want to change.

Example:

public static int CONSTANT = 5

defult package.. im guessing you mean the import statement? Usualy its just:

import javax.swing.*;

unless you're doing a more complecated program..

not sure about the other, I'm only in Computer Science 1
 
Unqualified names are variable names whose type is present in more than one imported/extended classes.

So, in English that means that if you're importing javax.util and javax.swing and for whatever bizzare reason there is a class "Widget" that is present in both packages, you have a problem if you create a variable "Widget w;". That will throw all kinds of exceptions/errors/whatever, since the interpreter can't tell what class you're referring to. This is a relatively rare error, but it is present. In order to fix it, look for the object's definition in two or more packages/classes that your class uses, and decide which one you want. Delete the other importation/extension and you should be golden.

No gurantees though :cheers: .
 
Back
Top