Category: java

Java: running program when path not set

Tutoring comp sci, you experiment a lot. The tutor shares one. The java command, in Windows, anyway, seems to like a space between the directory and the filename you are running. java -cp f:/dir1/dir2 program_file not java -cp f:/dir1/dir2/program_file Source:

Tagged with: ,

Java: overriding methods: what it means, and rules about it

Tutoring Java programming, you might be asked to clarify about overriding. The tutor shares some thoughts. In Java, when you override a method, you either define its performance (give it a “body”), or else redefine (change) its performance . Case

Tagged with: , , , ,

Java compile error: non-static method cannot be referenced from a static context – what causes it?

Tutoring Java programming, this error message might come up. The tutor talks about a couple of its causes. The message error: non-static method MethodX() cannot be referenced from a static context has a couple of causes I know: The class

Tagged with: ,

Java programming: constructors in subclasses

Tutoring Java programming, there are so many interesting facets to encounter. The tutor talks about a constructor of a subclass and the word super. Let’s imagine you write a subclass. Furthermore, let’s imagine the parent class (the superclass) has a

Tagged with: , ,

Java: the meaning of * used with import

The tutor offers an interpretation of what the asterisk (aka, wildcard) means in an import statement. I’m not trained in Java, but do write experimental programs with it. Here are some ideas about the import statement, as I understand it:

Tagged with: ,

Computer science: JavaScript: null value, undefined type and value

The tutor comments on JavaScript null and undefined. Null, it seems, is often mentioned in computer science. Perhaps it’s used a little loosely: it might refer to the value read when there’s nothing there, or the value of a variable

Tagged with: ,

Comp Sci: command prompt testing (Windows 7): how to kill a runaway program

The tutor brings up a couple of “emergency procedures” for stopping a program. I don’t write many big programs; rather, I’ll often write a page or so of code (with lots of white space) to test a utility from a

Tagged with: , , , , , ,

Java: why null might be used as an input parameter (aka argument)

The tutor looks into passing null as an argument. Sometimes, reading Java code, you encounter null being passed as an argument aka parameter: method0(null); Apparently, when a method expects an object parameter, but doesn’t (necessarily) use it, you can pass

Tagged with: , ,
Top