Most voted "null" questions
In computer programming, null is a special value for a pointer (or any other type of reference) that indicates that this pointer intentionally does not refer to an object (null pointer)
Learn more…114 questions
Sort by count of
-
50
votes6
answers16518
viewsWhat does NULL really mean?
Many people talk about what NULL is, but after all, what is its true meaning?
-
48
votes6
answers7903
viewsWhen should we allow a column of a table from a database to accept NULL?
This is a conceptual question that always creates confusion when deciding whether or not a column should accept NULL. There’s a current that considers the use of NULL to be an error and that an…
-
42
votes4
answers18382
viewsWhat is the difference between null and Undefined?
Most programming languages have a "null" type to represent the absence of a value. It can have multiple names (null, nil, None, etc), but its purpose is the same (with the exception of SQL, where…
-
33
votes4
answers5507
viewsWhy are NULL values not selected?
When making a select, I noticed that the data with field NULL are not recovered using the operator<>. Why does this happen? NULL is equal to a char N? See that in the query below only the…
-
29
votes1
answer1107
viewsWhat is Null Byte Injection? How to avoid it?
What would that be Null Byte Injection? How to avoid it?
-
21
votes4
answers44155
viewsHow to test null values in Javascript
I found the next code, and I got the impression that it didn’t make much sense. function (data) { if (data != null && data !== undefined) { // codigo } } From here, three different scenarios…
-
20
votes2
answers13387
viewsWhat is the difference between "NULL", "0" and 0?
Both are worth zero. I can use the 3 interchangeably always?
-
16
votes4
answers4276
viewsShould I initialize strings (or objects in general) with null?
I have noticed that a common practice among programmers is to initialize an attribute of a class with null. Is this good practice or not? Is there a difference between initializing with null or not…
-
12
votes2
answers736
views -
10
votes1
answer12629
viewsWhy should we use "IS NOT NULL" instead of "<> NULL"?
I’ve always wondered why we should use IS NOT NULL instead of <> NULL? For when I do as in the second case, no result is found. Example: SELECT * FROM tabela WHERE campo IS NOT NULL Displays…
-
10
votes2
answers3515
viewsWhat is the difference of an empty string and NULL in SQL?
What’s the difference of storing a string as NULL or empty in SQL? How these two can behave when I go to make one SELECT, or INSERT worthwhile '' in that column which is of the type varchar? If I…
-
8
votes2
answers213
viewsDo I need to assign null to a variable after use?
There is a need to allocate null in the object after its use? In the example below just after using the list I have a method that takes a lot of time to run. I need to assign null to the list to…
-
8
votes1
answer148
viewsAccess null pointer is not generating error
Testing the code below, I noticed a strange behavior. It’s working when it shouldn’t. The correct in my view was to give a segmentation failure and abort, but it seems that the compiler is doing…
-
8
votes4
answers8025
viewsCheck if int is "null" in C#
Cannot assign on C# null at an integer value (int, nay int?). However, how can I know if an integer value (int) has not yet had an assigned value (being of the type int)? int? valor; if (valor ==…
-
8
votes4
answers2092
viewsNull values in PHP
In PHP 7 which is the correct way to define and identify null values? Which of these is the correct way to assign null? $valor = null; $valor = ""; Which of these is the correct way to identify null…
-
7
votes1
answer1273
viewsIf the field has DEFAULT it must be NOT NULL?
Situation I was adding a few more columns to a table and falls from this thought. By default here we leave all fields can have value NULL, however if he has a DEFAULT he will insert the DEFAULT in…
-
7
votes3
answers972
viewsWhy are there so many ways to check if a value is NULL? How to standardize?
There are certain things still that do not enter my mind regarding PHP. Because there is a function is_null, when we can simply compare the values using a comparison operator. For example $variable…
-
7
votes1
answer309
viewsJava how to compare "float" to "null"?
public class NuloOuNao { public static boolean isZero(float num) { if(num == null) { return true; }else { return false; } } public static void main(String[] args) { isZero(10); } } Row 5: The…
-
6
votes2
answers2348
viewsThe following database modeling is in my head?
I created this modeling (just an idea), so there are no null/white fields. I have not completely reviewed it. There may be fields that would remain blank. The matrix table was the Entities and…
-
6
votes4
answers10625
viewsConstructing SQL tables - use or not fields with Not Null?
I have a question regarding the construction of tables and field use Not Null. I know that for fields of Primary Key, it is necessary for him to be Not Null, but in other fields, what is the need to…
-
6
votes3
answers625
viewsHow to treat Nullreferenceexception with Lambda
I have a class to search for DisplayName of my entities, where I pass the entity and class returns a list with the real values and name of each attribute of the entity. My problem itself is when I…
-
6
votes1
answer1727
viewsWhat is the difference between Type-safe and Null-safe?
I’m writing an article about Kotlin, and I came across these guys, if anyone can help me. What is the difference between Type-safe and Null-safe?
-
5
votes1
answer361
viewsWhat is the difference between NULL and null?
Is there any difference between the NULL (in capital letters) and null (lowercase) in PHP? I know I can use both types, but there’s some rule of naming those words?…
-
5
votes2
answers154
viewsIs there a rule for "type statements in class properties"?
PHP 7.4 supports type declarations in class properties. In a normal routine I would use: /* @var array */ protected $names; Now in PHP 7.4 I can: protected array $names; But if I declare it this way…
-
4
votes3
answers109
viewsIn PHP, is NULL a constant or a keyword?
In PHP, NULL is a constant or a keyword? I’ve heard it’s a constant, but it looks like the keyword behavior of PHP (that do not differentiate capital from minuscule)? Example: echo NULL; echo null;…
-
4
votes2
answers1190
viewsThe Operator != is Undefined for the argument type(s)
I am trying to create a method to save users in the database by doing the following check if the id past user is different from null he changes if not he registered. Code public void salvar(Usuario…
-
4
votes1
answer84
viewsWhat good is C-EPERM?
What is the purpose of the -EPERM, after comparing the pointer p is null if(p == NULL) return -EPERM ; And I have to put these two libraries. #include <errno.h> #include <stddef.h>…
-
4
votes2
answers4608
viewsSQL - How to select or delete a column with value equal to null in a query select
I have a table in a Mysql comic that has 5 fields. This would be a model query: select * from myTable where campo1= 4 and campo2=1 and campo3 =7. However field 3 may have null value and I would need…
-
4
votes2
answers1349
viewsHow to convert a nullable int to common int
I have a method that gets an integer that can be null, if it happens some executions of methods, but when I will use the same variable in a place that uses int which cannot be null, it appears that…
-
4
votes2
answers609
viewsDifference between ?. and ?? in C#
I looked at the documentation of Microsoft but still I found it a bit confusing, the main things I managed to abstract were: "?." - is a conditional null operator and tests the value of the left…
-
4
votes2
answers68
viewsAutomatic null value check versus types like "Option<T>"?
I recently started learning Rust and was introduced to the type Option<T>, representing, through a sum type, the presence or absence of a value (mutually exclusive possibilities). This same…
-
3
votes1
answer852
viewsHow to change null field to not return anything?
In a query has many fields not being filled in, would like to exchange the null that is being printed so that nothing appears in the print.
-
3
votes3
answers135
viewsDifference of null and another proposition using this null object
If I have a code, for example: if(window!=null && window.isOpen()){ //todo } If window for null, Will he still try to call the second proposition or not check anymore? Because if he tries to…
java operators nullpointerexception null conditionasked 8 years, 3 months ago Mateus Carvalho 1,494 -
3
votes1
answer514
views"toString()" returning Null when it should not
I have the class Aluno. public class Aluno { private String nome; @Override public String toString() { return this.nome; } //metodos getters e setters } Class Vetor public class Vetor { private…
-
3
votes1
answer370
viewsVariable declaration with ! at end Swift 3
Why in some variable statements in Swift3 an exclamation mark is added (!)? For example: var _nome: String! var _idade: Double! What does this entail of differences? When to use?…
-
3
votes1
answer13093
viewsDifference between NULL, empty and Python blank
I’m making a Data Quality that receives a list with data from a Database and I have two rules: Null fields: Fields that are filled with the word NULL White/empty fields: Fields that come blank or…
-
2
votes2
answers2748
viewsPassing parameter null to a method
It is possible to pass/receive null parameters in Java. In C# I know it is possible using ? in kind. public DateTime Teste(DateTime? exemplo){...} In this case the example I know can come null, in…
-
2
votes2
answers1107
viewsUpdate the value obtained in an Edittext
Next, I’m having a problem taking the value in an Edittext and displaying it in a Textview. The value displayed when using a string, is "null", and when using int, is 0. I believe this happens…
-
2
votes1
answer95
viewsReturns Excel in C# List is returning null
This code reads a file Excel and plays a list, the problem that is occurring is it is returning null, like there’s nothing in the Excel, but the column names are correct: string PathConn =…
-
2
votes2
answers757
viewsNULL value in database x performance
I always used database (Mysql) for small projects and never cared about the option "NULL when empty", IE, was blank even. Now I’m designing a big system, I’d like to know the concept of using value…
-
2
votes3
answers806
viewsExchange array value when null
I have a Webservice in PHP that returns me a JSON with values from a mysql database. I need that, in an Array, whenever there is a null value (when = null), be replaced by white (= ""). I’m doing it…
-
2
votes1
answer165
viewsGPS on Android - Map=null
I’m making an app for people with addresses. Every time I open the map setting the initial location with the phone’s GPS, the app locks and closes. [UPDATE] When analyzing the code I realized that…
-
2
votes1
answer2244
viewsHow to check if there is a null attribute in the object?
I have a class Person and I want to check if there is any null attribute, any one because I can’t save a person null-attribute. I want to avoid a lot of if. Is there any way to do that? public void…
-
2
votes2
answers4575
viewserror "Undefined object reference to an instance of an object." when displaying a null value in the view
Within C# MVC5, I am creating a user registration form with several fields. One of them is the Function (Bonus) field, which the user may or may not have. Follows the User class: public class…
-
2
votes4
answers3541
viewsHow to bring records of a LEFT JOIN even if not obeying the WHERE?
Exemplifying, I have the tabela_A: cod nome 1 stack 2 overflow 3 stackoverflow and tabela_B: cod_tabela_A ano mes valor 1 2016 1 100 1 2016 2 115 2 2016 1 90 When made a LEFT JOIN, returns me the…
-
2
votes0
answers99
viewsSelect MYSQL, list row not present in NULL table
I’m making a hotsite with a quiz (questions and answers), with more than 3000 users. The question is in the list of quizzes for each user, I have two tables (simplified to focus on my question):…
-
2
votes1
answer26028
viewsCompare NULL using CASE SQL
I have to recover 2 fields in this query (number of projects and the management that runs such a project). This query will be used to generate a report in JASPER and it does not display field with…
-
2
votes2
answers355
viewsAdvantage in giving null in a variable on Android
Assign the value of null in a variable on Android can improve application performance? As far as I know, in Java we have the Garbage Collector, and in Android, the activity cycle of Activities and…
java android null variable-declaration garbage-collectorasked 7 years, 4 months ago Guilherme Ramos 343 -
2
votes2
answers1290
viewsHow to check Null in a select @Local_variable
To set a default value for a local variable, if the select that should "set" it returns NULL? For example: DECLARE @Minha_Var VARCHAR(70) SELECT @Minha_Var = Nome FROM CLIENTES WHERE Id = 10 This…
-
2
votes1
answer1245
viewsHow to handle Null records? In the database or app? (java & Mysql)
I am integrating a legacy database (Mysql) with a new module (Java - this problem object is a bean) that I am developing. I have a method that makes a select and returns some results that eventually…