Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
4 votes

Are jUnit or TestNG simple enough for undergraduates to apply in a matter of weeks? What alternative?

Good on you for adding this into your class! But I admit that sounds it like a lot in a short time to me. My only practical thoughts are to (1) provide some starter code that gets the lab project ...
Ben I.'s user avatar
  • 33.7k
2 votes

Are jUnit or TestNG simple enough for undergraduates to apply in a matter of weeks? What alternative?

If you are willing to use TDD, even in an elementary course there is a solution. I've used it, though with older students. On the first day of the term, give a demo about how to develop a piece of ...
Buffy's user avatar
  • 36.4k
2 votes
Accepted

When teaching Java, should I teach try-catch from the outset?

I'm not sure what the progression is in your education system, but the one I went through to learn programming as a complete novice in Java (~2015, in the USA, at a community college) went roughly ...
ggorlen's user avatar
  • 794
2 votes

When teaching Java, should I teach try-catch from the outset?

This answer is based on a software engineering point of view, in not teaching things that contradict best practices. (And there are lots of misconceptions and bad practices around exception handling, ...
Ralf Kleberhoff's user avatar
2 votes

When teaching Java, should I teach try-catch from the outset?

You may need to teach this concept, but I'd do it at the point it becomes be best option. If things can fail, some sort of test or similar action is needed. For a list of objects, one can return null ...
Buffy's user avatar
  • 36.4k
2 votes
Accepted

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

You probably want an ArrayList. They can be resized, however. Python has a similar thing. You should become familiar with the oracle docs of which the above link is a part. They are quite informative. ...
Buffy's user avatar
  • 36.4k
1 vote

When teaching Java, should I teach try-catch from the outset?

Create a type value or error (but nothing else: so not object) e.g. ...
ctrl-alt-delor's user avatar
1 vote

When teaching Java, should I teach try-catch from the outset?

In Java and many other languages that followed it, Exceptions are un-exceptional: e.g. it is not exceptional to get to the end of a file. Your example of removing an item from an empty list, is a ...
ctrl-alt-delor's user avatar
1 vote

Parent class variable pointing to Child class

Dog rover = new Puppy("rover"); The main thing to consider here is that this is not the main purpose of polymorphism. It is indeed unnecessary to use the ...
Flater's user avatar
  • 1,361
1 vote

Explaining access levels and visibility in OOP

This year, I used the example of student grades that seemed to work pretty well (C++): The Student class has a private _grade. ...
MakisH's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible