jGrasp is an IDE brewed at Auburn University that offers visualization of coding data structures. It is a teaching tool for programming and data structure course using Java. This article shows how to configure and run JUnit test cases in jGrasp.
In addition to using the
Comparable interface, there is another standard interface we can use to compare objects for equality, and inequalities (greater than, or less than): using the
In the previous article, we see how we can define equality in our class and compare two objects using the
equals() method. In this article, we are going to define additional less than and greater than relations in our class using the
In the language of Java, a collection is just a set of objects. A collection may or may not have order depending on how the collection class is implemented. Examples collection are
Set (unordered), and
Every class in Java has an
equals() method inherited from the
Object class. Newcomers to Java may be asking what is the purpose of this method? As a side note, C# has the similar method. The
equals() method is used to compare two objects (usually of same class). If the objects are logically the same, then the method returns
Welcome to core Java concepts! I am glad you decided to join us to learn how to write programs in Java! This series of tutorials is intended to cover the foundations of Java. We will start from the most fundamental concepts of programming and progress to cover most of Java programming techniques and features. If you have very little or no programming experiences, do not worry! This series will start from the fundamentals. If you are experience with Java, later tutorials of specific topics may be useful to you.
In previous articles, we explained how CSS float allow text to flow around an block element and how to create two column layout using floats. By columns, we do not mean dividing a long section of text into multiple columns, like in books or research paper. What we mean is dividing a page into columnar sections, where each for different content. In this article, we add one more column and design a three column layout using the floats.
A common layout of websites is that the main content of the site does not take the entire width of the browser window and the content is centered on the page. For example, the content of the CNN site is fixed at 1000 pixels in width and centered. The content area can then be organized with sub-layouts or divided into multiple columns. This article describes how to center the HTML block elements on a page using two methods: using
align attribute, and using CSS margin.