John Held

Greenhorn
+ Follow
since Jun 13, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Held

The following code compiles and apparently is an example of shadowing a static method. It sure looks like a static method overwriting another static method to me.
Does anyone have any insights?
public class A
{
public static void sM1() { System.out.println("In base static"); }
}
class B extends A
{
public static void sM1() { System.out.println("In sub static"); }

}
JQ+
I've been studying Java using the Complete Java 2
Certification guide.
Now I'm looking at JQ+ and was working on some
garbage collection questions--a lot of them about finalize() which is only covered under the Developer section.
I'm curious if JQ+ covers material I don't really need to know.
Any opinions?
--John
Thanks. I was able to create a sequence with midi events. If anyone knows of better descriptions of the values which need to go in various midi events (the API seems pretty dry for this information and the midi site reference is pretty feeble) let me know.
17 years ago
www.jsresources.org has some examples that may be worth taking a look at.
17 years ago
Thanks Rob,
The import statement is as follows:
importjavax.sound.midi.MidiEvent;
Any ideas on the correct way to add the
event?
--John
17 years ago
Ambitious I know, but I the problem I'm having
illustrates the difference between book-learning and writing real Java programs
According to the Sequence API, I can create a
new MIDI (music) sequence, add a track to it, and
then add midi events to it.
1--in spite of the right import statement, I seem
to have to add "javax.sound.midi.MidiEvent" for
the t.add statement to find the "setTick" midi function.
2--Even though Midi2 is not static, I get the message "non-static method set.Tick(l) cannot
be referenced from a static context"
Help -- code below!

public class Midi2 {
Midi2() {
Sequence seq = null;
try {seq = new Sequence(0.0f, 500);} catch (InvalidMidiDataException e)
{System.exit(0);}
Track t = null;
t = seq.createTrack();
long l = 500;

t.add(javax.sound.midi.MidiEvent.setTick(l));
17 years ago
I'd like to have an alternative to Thread.sleep
which can be used as an accurate timer. Anyone
know of such a timing method?
I'm replying to my own question--found this site.
http://www.jsresources.org/examples/SynthNote.java.html
I'm still curious if anyone has some further advice.
17 years ago
I'd like to be able to create some midi sound files. Any pointers or advice?
17 years ago
It sure seems like it out to be six objects
to me. -- not an expert though.
Does anyone know how the market is in California for Java programmers?

Austen Texas? Seattle? Portland?
17 years ago
It seems like one of the difficulties in fully understanding Java is that it is difficult to find an organized list of Java's rules--and then
the exceptions to the rule.
Does anyone know of such an organized list?
Here is an example of what I'm talking about:
Rule: a switch argument can be anything smaller or equal to an int
Exception: if one of the case statements contains a number larger than the type of switch argument, we have a compiler error
Example:
byte a = 7;
switch (a) {
case 128:
System.out.println("We have a problem here.");
break;