- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Java String Class?
Strings, which are widely used in Java programming, are a sequence of characters. In Java programming language, strings are treated as objects. The Java platform provides the String class to create and manipulate strings. The most direct way to create a string is to write −
String greeting = "Hello world!";
Example
public class StringDemo { public static void main(String args[]) { char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.' }; String helloString = new String(helloArray); System.out.println( helloString ); } }
Output
hello.
- Related Articles
- What is special about string class in Java?
- What is the package for String Class in Java?
- Java String Class Tutorial
- String class in Java
- What is the class "class" in Java?
- Why String class is immutable or final in Java?
- Difference between String class and StringBuffer class in Java
- What is a Java class library?
- What is AbstractSequentialList class in Java?
- What is AbstractCollection class in Java?
- What is AbstractList Class in Java?
- Check whether String is an interface or class in Java
- What is the super class of every class in Java?
- What is Java String literal?
- What is the root class in Java?

Advertisements