Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to import java.lang.String class in Java?
To import any package in the current class you need to use the import keyword as
import packagename;
Example
import java.lang.String;
public class Sample {
public static void main(String args[]) {
String s = new String("Hello");
System.out.println(s);
}
}
Output
Hello
Advertisements