|
272 | 272 | { |
273 | 273 | "query": "What is the correct expression to see if an integer is odd in Java?", |
274 | 274 | "response": "The correct expression to check if an integer is odd is `n % 2 != 0`. `n % 2 == 1` is incorrect because this expression will not work for odd negative integers.", |
275 | | - "credit": ["Kurt Wanner"] |
| 275 | + "credit": ["Kurt Wanner", "Yi-You (Joseph) Chiu"] |
276 | 276 | }, |
277 | 277 | { |
278 | 278 | "query": "What is XML?", |
|
342 | 342 | { |
343 | 343 | "query": "What is the difference between parameter and argument?", |
344 | 344 | "response": "A parameter is the variable used within the method implementation. The argument is the value you pass into the method.", |
345 | | - "resource": "https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter", |
346 | 345 | "credit": ["Lucas Curran"] |
| 346 | + }, |
| 347 | + { |
| 348 | + "query": "What is the difference between an expression and a statement?", |
| 349 | + "response": "A expression is a a piece of code that can be evaluated into a value. A statement is a part of code that can perform an action or task.", |
| 350 | + "resource": "https://therenegadecoder.com/code/the-difference-between-statements-and-expressions/", |
| 351 | + "credit": ["Peter Sung"] |
| 352 | + }, |
| 353 | + { |
| 354 | + "query": "What is API?", |
| 355 | + "response": "APIs are mechanisms that enable two software components to communicate with each other using a set of definitions and protocols.", |
| 356 | + "credit": ["Yingqi Gao"] |
| 357 | + }, |
| 358 | + { |
| 359 | + "query": "What is a boolean?", |
| 360 | + "response": "A boolean is a data type that can only hold one of two values: true and false, or 1 and 0.", |
| 361 | + "credit": ["Oliver Gwynn"] |
| 362 | + }, |
| 363 | + { |
| 364 | + "query": "What is the difference between a public and private method?", |
| 365 | + "response": "public: scope to make that property/method available from anywhere, other classes and instances of the object. private: scope when you want your property/method to be visible in its own class only.", |
| 366 | + "resource": "https://therenegadecoder.com/code/the-difference-between-private-and-public-in-java/", |
| 367 | + "credit": ["Sammy Schwartz"] |
| 368 | + }, |
| 369 | + { |
| 370 | + "query": "What is design by contract for?", |
| 371 | + "response": "Design by Contract declares what should be met by a client (caller) in pre-conditions, what should be met by the implementer (callee) in post-conditions and what is forever true in all conditions. Based on the presumption, we are able to recognize who is supposed to take the responsibility of repairing defects.", |
| 372 | + "credit": ["Darin Renusch"] |
| 373 | + }, |
| 374 | + { |
| 375 | + "query": "What is RSS?", |
| 376 | + "response": "RSS (Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format.", |
| 377 | + "credit": ["Andy Vong"] |
| 378 | + }, |
| 379 | + { |
| 380 | + "query": "What is the difference between Inheritance and Polymorphism?", |
| 381 | + "response": "Inheritance allows for one class (child class) to inherit the fields and methods of another class (parent class). For instance, we might want a child class Dog to inherent traits from a more general parent class Animal. Whereas, polymorphism allows a child class to share the information and behaviour of its parent class while also incorporating its own functionality.", |
| 382 | + "credit": ["Jatin Mamtani"] |
| 383 | + }, |
| 384 | + { |
| 385 | + "query": "What is a precondition?", |
| 386 | + "response": "A precondition is a condition for a method that the client has to follow when entering input or passing parameters, in order for the method to produce expected results promised by the implementer.", |
| 387 | + "credit": ["Akshaya Iyer"] |
| 388 | + }, |
| 389 | + { |
| 390 | + "query": "What is short-circuit evaluation?", |
| 391 | + "response": "Short-circuit evaluation is when a compiler skips the execution or evaluation of some sub-expressions in a logical expression (ex: in a while loop or if statement). The compiler stops evaluating the further sub-expressions as soon as the value of the expression is determined. This practice is often used to save resources and memory, leading to more efficient code.", |
| 392 | + "credit": ["Junbo Chen"] |
| 393 | + }, |
| 394 | + { |
| 395 | + "query": "What makes two if statements independent?", |
| 396 | + "response": "Two if statements are independent if they use they both use the `if` keyword without an else (note: sometimes lazily referred to as if/if). Alternatively, if statements can depend on each other if they make use of the `else` and `else if` keywords (note: sometimes lazily referred to as if/else).", |
| 397 | + "credit": ["Jarrett Reeves", "Jeremy Grifski"] |
347 | 398 | } |
348 | 399 | ] |
0 commit comments