Questions tagged [language-concepts]

Use this tag to ask about how a particular idea (arrays, lists, tables, search, sort) is implemented in language X or how to understand a basic part of the language.

Often there is a particular concept that isn't quite grouped into any of the other tags, or it is just too embarrassing because it's a "newbie" idea. Or there isn't a concrete problem to solve and you were just wondering about how something works in language X.

If you wanted to ask about which version of the moot() function is used if class A is inherited from class B and implements C, tag it with inheritance..

But also use this tag to point out it's more of a "Hmm..." question than a "How do I solve this" question.

98 questions
0
votes
0 answers

Java - onFormClosing conversion C# to Java

I would like to ask if someone can help me with the following: I am trying to complete the following in Java. I am still quite new to Java and I hope that this can be achieved. Please note that this C# code might not be 100% correct, but I hope you…
Joandre Tait
  • 23
  • 1
  • 8
0
votes
2 answers

In Eiffel, what is the difference between entities, variables, fields and arguments?

I've seen the terms entity, variable, and argument used to describe things about Eiffel, that look quite similar to me, and I wanted to understand what is the intention behind using either term instead of the other. Arguments — Some routines require…
g4v3
  • 133
  • 2
  • 10
0
votes
1 answer

PHP Architecture: Save and use "constants" in whole system

I use my PHP (like normal) in a server architecture where I have an incoming request and build an outgoing response. All request attributes (like client ID) are given to each sub function and class to make magic with (like in my Mappers and Models…
David Pauli
  • 89
  • 2
  • 12
0
votes
1 answer

Programming Concept: What is splitting a number into groups of other whole numbers?

I know there must be an official name to this but unfortunately I have forgotten the term. I have an integer which changes, lets say its 10. I want to divide this into however many groups as long as the result in each of the groups is 3. The…
Galagargh
  • 3
  • 2
0
votes
1 answer

Bad example in the Oracle's docs

I read this Oracle's article about Interfaces in Java. I think, that the provided example is bad. They use the following example: public interface Relatable { public int isLargerThan(Relatable other); } public class RectanglePlus implements…
Victor Dombrovsky
  • 2,955
  • 3
  • 21
  • 33
0
votes
2 answers

Javascript - How do I invoke an anonymous method as a variable and access its properties and methods?

I've read that we can invoke an anonymous function as a variable. However I'm trying to do that and in addition to it I want to access its properties and methods. Here is my code var cooking = function(){ this.dessert = "Ice Cream"; …
0
votes
2 answers

In Javascript is an String literal an object?

I'm reading about the difference between String literal and String objects. See What is the difference between string literals and String objects in JavaScript? But I'm a bit confuse because there it's explained that you can use methods of the…
GniruT
  • 731
  • 1
  • 6
  • 14
0
votes
1 answer

Can we modify the methods of immutable objects in Javascript?

I'm going crazy with the concept of immutability in Javascript. The concept is explained like "after it has been created, it can never change." But what does it exactly mean? I understood the example of the content of a string var statement = "I…
GniruT
  • 731
  • 1
  • 6
  • 14
0
votes
0 answers

Materials on important "concepts" in programming

I'm looking for materials (book, video lecture, ...) that explain "important concepts" in programming such as interface and implementation, types and values, subtyping and inheritance, polymorphism, referential transparency and side effect,…
0
votes
2 answers

How to instantiate an object using it's constructor outside a method java

I'd like to instantiate an object with it's constructor outside a method. Example: public class Toplevel { Configuration config = new Configuration("testconfig.properties"); public void method1() { config.getValue(); ...etc …
mosawi
  • 1,283
  • 5
  • 25
  • 48
0
votes
1 answer

Hoare logic proof

Give a proof that the following is correct. {n != 0} if n<0 then n= -n {n>0} The following inference rule should help {B and P} S {Q}, (not B) and P=>Q --------------------------------- {P}if B then S{Q} I have been looking all over the…
0
votes
1 answer

How to Retrieve Another Statement Records Using HashTable?

Good Evening, I try to use the HashTable() for storing a database table records temporarily . The problem is I dunno why the records which being put inside the HashTable() will always be the first record. I think the problem occur is because of the…
薛源少
  • 306
  • 1
  • 6
  • 18
0
votes
2 answers

Why variables are not allowed for binding

I was googling for this point where why the local or global variables are not allowed as sources for WPF data binding; only the wrapping property can be bound to. So the question is where properties are the wrapper over the variables then why these…
JSJ
  • 5,653
  • 3
  • 25
  • 32
-1
votes
1 answer

incorrect output in PyCharm

This is my homework. When I run this code, I should get an output like " result [(arrivaltime:Mon Mar 9 14:10:00 2020, user:mary, session:42, event:click, usrfield:13)] " but I got an incorrect output which is " [
sube
  • 1
  • 1
-1
votes
1 answer

How can I test a method quicky in Java?

I'm trying to solve a problem of codingbat. I have to write a method that given two non-negative int values, returns true if they have the same last digit. I'm trying to test quickly if my solution is correct so I create a class LastDigit and…
GniruT
  • 731
  • 1
  • 6
  • 14