Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. J

    JavaScript Why is the placement of the first declaration of my let variable being misinterpreted?

    It’s an old trick. To be fair you shouldn’t use it nowadays. Compiling with strict will reject it now. Sorry. (Although you were using it implicitly with your multiple déclaré/assign) You could try using the global window object, ie. window.mixamnt
  2. J

    JavaScript Why is the placement of the first declaration of my let variable being misinterpreted?

    I still think it’s a scope problem. Declaring the variables separately with let won’t fix it because they still have block scope. Your problem references are in callback functions that will be called asynchronously sometime later. This means that they do not share the execution context of the...
  3. J

    JavaScript Why is the placement of the first declaration of my let variable being misinterpreted?

    This looks like it may be one of those tricky aspects of JavaScript... let a = b = c = 0; is executed right to left, ie it's equivalent to c = 0; b = c; let a = b; So b and c are created with global scope whereas a has block scope. I can't see all of your code to understand the block structure...
  4. J

    Java Why there is no output in my code?

    Works for me too. Does Hello World work for you using the same setup?
  5. J

    C# Please help me with list <>

    Yes.
  6. J

    C# Please help me with list <>

    Is it the < > notation that’s confusing you? If so… with an ordinary List you can put any kind of object into it, and have no guarantees about what kind of object you will get when you retrieve from the List. By adding a class name in < > you specify that the list can only contain objects of...
  7. J

    C# Please help me with list <>

    GetBrowsers is a function that returns a List of BrowserVersion objects its first line creates a variable whose type is List of BrowserObjects, and creates an empty instance of that type
  8. J

    Need help troubleshooting JMeter Interview Questions

    I assume this is Java? That seems to be calling methods that are not present in the standard Java API ThreadGroup class. Are you using some other library?
  9. J

    Can Anyone Help With Repairing The Bug In This Code?

    For choice 4 you have omitted the ‘if”.
  10. J

    Java What are the potential difficulties to consider while implementing a marker interface in Java?

    I agree. Bring endangered is subject to change, so needs must be implemented by a variable updatable at run time. Marker interfaces are useful for class attributes that are fixed at compile time (eg Serialisable) and have the big advantage that the compiler can then check for any errors related...
  11. J

    Java What are the potential difficulties to consider while implementing a marker interface in Java?

    That’s a misunderstanding. A class can only extend from one parent, but it CAN implement any number of interfaces. See the Java Language Spec. https://docs.oracle.com/javase/specs/jls/se19/html/jls-8.html#jls-8.1.5 or try interface A{} interface B{} public class MyClass implements A,B {...
  12. J

    What is the output of this?

    It’s 1+ (the sum of 5 odd numbers) - so that has to be even.
  13. J

    Read Me How did you find us?

    It got favourable mention on DaniWeb
  14. J

    What is everyone working on?

    I’m building a Hierarchical State Machine processor in Java. I always wondered how, in real life, you got from a UML FSM diagram to working code, and this is a way to explore that question. (There are lots of simplified answers on the web but they ignore all the tricky details.)
  15. J

    Fun activity Say hello... in a coding language!

    Language: APL ’hello PGen98’ (APL’s default action for any expression/result is to print it)
  16. J

    Fun activity Say hello... in a coding language!

    class X {static{System.out.println("Hello pritaeas - another refugee?")}}
  17. J

    Java Simple 10 second question for if an integer is defined in blocks of code

    Arcane indeed. You may see them: instead of a constructor in an anonymous inner class (this is the only necessary use) or to initialise a map or whatever next to where it’s declared (i do this fairly often) on the other hand static initialiser blocks can be very useful to initialise class...
  18. J

    Java How to learn java

    One thing to watch out for, especially with books… Java is an evolving language. New features are added all the time, often to fix problems or annoyances in previous versions. Tutorial web sites are mostly out of date to some degree or another. I know of some that haven’t been updated for a...
Back
Top Bottom