In AngularJS, what’s the difference between ng-pristine and ng-dirty?

The ng-dirty class tells you that the form has been modified by the user, whereas the ng-pristine class tells you that the form has not been modified by the user. So ng-dirty and ng-pristine are two sides of the same story. The classes are set on any field, while the form has two properties, $dirty and $pristine. You can use the $scope.form.$setPristine() function to reset a form to … Read more

Can an int be null in Java?

int can’t be null, but Integer can. You need to be careful when unboxing null Integers since this can cause a lot of confusion and head scratching! e.g. this: will give you a NullPointerException, despite object not being null! To follow up on your question, if you want to indicate the absence of a value, I would investigate java.util.Optional<Integer>

How to extract .war files in java? ZIP vs JAR

If you look at the JarFile API you’ll see that it’s a subclass of the ZipFile class. The jar-specific classes mostly just add jar-specific functionality, like direct support for manifest file attributes and so on. It’s OOP “in action”; since jar files are zip files, the jar classes can use zip functionality and provide additional utility.

What are database constraints?

Constraints are part of a database schema definition. A constraint is usually associated with a table and is created with a CREATE CONSTRAINT or CREATE ASSERTION SQL statement. They define certain properties that data in a database must comply with. They can apply to a column, a whole table, more than one table or an entire schema. A reliable … Read more