Questions tagged [data-types]

A data type is a classification which tells the computer how the program intends to use the data. Use for questions about instruction that involves type (boolean, string, integer, etc).

Filter by
Sorted by
Tagged with
1 vote
1 answer

Is there an array-like data type in Java that can cope with generic types better than the built-in array?

TL;DR I'm looking for a replacement for the primitive array data type in Java that works better with generic data types. Background: I'm teaching A level CS in the UK (age 16-18) and we're using Java ...
Andrew Stacey's user avatar
5 votes
7 answers

Concept of variable

For a beginner Is it right to use the concept of hotel room and passenger as an analogy to explain the concept of variable?
Milla's user avatar
  • 169
4 votes
2 answers

Abstract data type that has "include" "remove" and "is in" and only those

In a data structures course, we see trees, balanced trees, hash tables. These have an important thing in common: we can use them to keep a collection of elements (with operations add and remove) and ...
josinalvo's user avatar
  • 331
4 votes
1 answer

Example for Introduction to Generics in Java

What are some good example classes for introducing generics in Java? I'm introducing this in the context of implementing ArrayList, but I don't want my first ...
cryptic_star's user avatar
1 vote
3 answers

Data and Database modelling books

I need a suggestion for books for my University. I have a subject called "Data and database modeling" but we lack of books. Our professor gave as barely understandable scripts. This is an official ...
NVelichkovski's user avatar
26 votes
9 answers

Once implicit/inferred typing is introduced, how can I impress upon students the importance of not abusing it?

I typically have the same students two semesters in a row, for programming I (VB.NET) and programming II (C#). In our early, impressionable time together, I stress to these students (high-schoolers) ...
Java Jive's user avatar
  • 2,349
7 votes
7 answers

Explaining to students why to use double instead of float (unless there's a very good reason)

I keep seeing students use float in lab lessons: For example, a simple physics calculation of kinematics. Many, many students use ...
ItamarG3's user avatar
  • 6,287
7 votes
5 answers

Breaking down the operations when auto-casting gets complex

So, take a Java statement like this one, given some int n: if ((n+"").length() == (((n+1)+"").length())) { Or perhaps this ...
Ben I.'s user avatar
  • 32.9k
7 votes
3 answers

Teaching "CS integer" vs. "math integer"

The concept of an integer data type is not equivalent to the math concept of the set of integers. For example, in many programming languages the expressions 3. and $...
Bennett Brown's user avatar