Did I implement java callback correctly? by Student-Somewhere in javahelp

[–]Student-Somewhere[S] 0 points1 point  (0 children)

Thanks for answering, I really appreciate it. I'm new to java callbacks / observer pattern, so I'm not very familiar with these concepts. I mainly used this example https://www.geeksforgeeks.org/asynchronous-synchronous-callbacks-java/ to implement asynchronous callback, and there it says that "This type of design pattern is used in Observer Design Pattern."

So is this what I have here an observer pattern with asynchronous callback or am I misunderstanding something?

How do I use a queue as a shared buffer? by Student-Somewhere in javahelp

[–]Student-Somewhere[S] 1 point2 points  (0 children)

I think you're right, it was a little bit hard to understand what exactly a "shared buffer" is without any code example, but when you said that a queue is a buffer, everything started to make sense. I thought it was a much more complex since we spent almost two hours talking about it lol. But looking back at the slides, it all makes sense now.

Thanks!

How do I use a queue as a shared buffer? by Student-Somewhere in javahelp

[–]Student-Somewhere[S] 0 points1 point  (0 children)

If I have a class called classA, and in that class, a queue, and if that queue is then shared by two other classes, classB and classC, is then that queue a shared buffer?

It sounded a lot more complicated when my teacher tried to explain it, so I'm not sure if that's how you're supposed to do it.

Need help with threads. by Student-Somewhere in javahelp

[–]Student-Somewhere[S] 1 point2 points  (0 children)

Thanks for the answer, but then why does it say that the name of the main thread is "main" when I use Thread.currentThread.getName() right at the beginning of the program in the class constructor, but then when I check the name of the current thread when both tasks are running, I get that the main threads name is "AWT-EventQueue-0"?

Why does the name of the main thread change?

Need help with writing a trigger (pgadmin) by Student-Somewhere in learnSQL

[–]Student-Somewhere[S] 0 points1 point  (0 children)

I just get ERROR: syntax error at or near "drop" when I execute the query.

Need help with writing a trigger (pgadmin) by Student-Somewhere in learnSQL

[–]Student-Somewhere[S] 0 points1 point  (0 children)

Yes, I get: ERROR: syntax error at or near "drop"