Java Strings

A String is an object that represents a sequence of characters.
For example, “HelloWorld” is a string of 10 characters.
For example:

String s = "HelloTech";

The + (plus) operator between strings adds them together to make a new string. This process is called concatenation.The resulted string is the first string put together with the second string.For example:

String firstName, lastName;
firstName = "sani";
lastName = "kamal";
System.out.println("My name is " + firstName +" "+lastName);
// Prints: My name is sani kamal
The char data type represents a single character.

One thought on “Java Strings

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s