Difference Between equals() and == in Java

The equals() method and == operator in Java perform two different operations. The equals() method is used to compare two string values. On the other hand == operator is used to compare two primitive datatype variables or to compare references of two objects. Below is a sample program that shows difference between equals() and ==… Read More »

Pros and Cons of Dating a Programmer

Today I was exploring the web to find something cool and funny related to programmer. Suddenly I found a comic that perfectly shows the good (pros) and bad (cons) parts of dating a programmer in funny way. If you are in relationship with a guy who is programmer then you should read this. I am… Read More »

Java Program to Sort List of Strings

Here is the Java program to sort list of strings. This program uses compareTo() method to compare the strings and finally uses bubble sort technique to sort them. compareTo() method compares two strings and return an integer value. The returned integer value is interpreted as show below. Less than zero: first string is less than… Read More »

Program for Armstrong Number in Java

Armstrong number is a n digit number such that the sum of digits raised to the power n is equal to the number. For example: 153 is armstrong number because here n=3 and 13+53+33=153. 120 is not armstrong number because 13+23+03!=120. Below I have shared a Java program that checks whether a number is armstrong… Read More »

Java String Comparison

String class in Java provides different methods for comparing strings or substrings within strings. In this tutorial I will discuss about those Java string comparison methods.   equals() and equalsIgnoreCase() We can use equals() method to check equality of two strings. It has following syntax. Syntax

  Here str is the String object and… Read More »

Character Extraction in Java

There are several ways by which characters can be extracted from String class object. String is treated as an object in Java so we can’t directly access the characters that comprise a string. For doing this String class provides various predefined methods.   Character Extraction in Java charAt() charAt() method is used to extract a… Read More »

Introduction to Python Programming

Python is a General-Purpose Programming Language or rather a Scripting Language. It was developed in 1990s by a person named Guido Van Rossum. Features of Python 1. Cross-Compiled i.e., Platform Independent or Portable 2. Interpreted 3. High-level Scripting Language 4. Open Source 5. Supports Object Oriented Features Python is an interpreted and a cross-compiled programming… Read More »