Java Strings

No Comments

A String is a sequence of characters, so whenever, we need a variable to hold a set of characters (username, password, name, address, sentence, paragraph, etc.), we use a String data type (object). Strings are different from the primitive data types as there is a String class with a collection of methods that allow us to manipulate String data and Strings are actually objects.

One mistake that beginning developers and even seasoned developers make is mistaking an empty (null) String for a ‘space String’. “” is different from ” “. Java has a whitespace Unicode character and a String can be comprised of a space, or a String can include a space as well. Therefore, “I love Java” has 11 characters as opposed to 9 characters as the spaces are included. Figure 1 illustrates this:

Figure 1. The space String gives a length of 1 but the empty String gives a length of 0
Categories: Uncategorized

Why…?

No Comments
Blog owner

Hi guys! In high school, I was all about literature. I was very good in English and I was good at writing stories and essays. I felt satisfied that I could comprehend how to decipher and write about just about everything around me, so I decided to study business. After high school, I attended community college and got a London Chamber of Commerce and Industry Secretarial Certificate.

I was particularly intrigued by my Information Processing class and wanted to know more about the intricacies of computers. I wanted to know why the Windows 95 system crashed so often and why our diskettes (floppy disks) would suddenly stop working. My curiosity grew and a few years later, I decided to go back to college and study computer science.

The first language I learned was Pascal, and we studied Pascal in Delphi. That first class was tough. I initially thought – what did I get myself into? But I stuck with it and I told myself that I wanted to learn this. Variables, data types, arrays, loops, and decision statements. I was bombarded with new terms and learning a ‘new language’ – of course. But, my curiosity peaked and despite going through a lot in my personal life, I decided to stick with it.

Welcome to my blog! I will walk you guys through my journey in learning computer programming, as well as how I dealt with difficulties and how I broke down concepts to become a better programmer.

Welcome, and I hope we have fun together!!!

Categories: Uncategorized