Saturday, March 25, 2017
Simple Program in Java that Reverses a String
So I decided to code a simple program today in Java because my laptop is down and I cannot access Visual Studio to program in C#, which is the language I'm used to.
The program reverses any string you input and displays it backwards.
I discovered something that Java doesn't have which C# does. C# treats a string as an array but Java doesn't. So in line 34, in C#, I could've typed "words[i] = str[count];". Which is syntactic sugar compared to Java. Yet C# is considered more complex than Java which you can read about in this link. Since I'm a novice in Java and have been groomed in C#, I guess I WOULD find C# must easier.
Below is my code. Please comment if you have an easier way to code this.
Subscribe to:
Post Comments (Atom)
How to Access the Metaverse
In February this year, Bernard Marr predicted that "in 2022, we'll see new, lighter, more portable VR devices, so instead of having...
-
The internet has established a new economy through cryptocurrency. I found a good read about Cryptocurrency in the article, What Is Cryptocu...
-
Imagine living in or visiting a city where you could find parking easily using an app through a smart parking meter through which you cou...
-
I often wonder how life would be like if we could use technology to extract data from the human brain as we see in movies. Like lodging a mi...
No comments:
Post a Comment