12
Dec
Method: String.startsWith();
It will return the boolean value.
public class Main {
public static void main(String[] args) {
String sentence="Hello Java";
System.out.println(sentence.startsWith("Hello"));
}
}
Output:
true
Related posts:
- Setup Java & Environment Variable What is Java Top 5 reasons to start with java...
- Write First Java Program 1. Run IntellIJ from start menu. Click on โCreate New...
- Variables in Java What is a Variable in Java? Variable is a data...
- Java Data Types Data types specifies what type and which size of data...
- Conditional Logic If-ElseConditional logic means to execute an operation depends on its...
- Loop Control Loop is used to execute a statement or some statements...
- Object-Oriented Programming Object-Oriented Programming is a very vital topic in java as...
- Class and Object Object-Oriented Programming is a very vital topic in java as...
- Method Method is the activity of an object. Different object can...
- Constructor Constructor is a special method in java. When method name...
- Inheritance Inheritance is a process where a class can acquire the...
- Encapsulation Encapsulation is a way to data hiding process where the...
- Polymorphism The word polymorphism means having many forms. It is one...
- Abstraction Abstraction is a process of hiding the implementation details and...
- Interface An interface in Java is a blueprint of a class....
- Java Array Examples Write a program to sort numeric numbers Write a program...
- File Handling File handling is very important topic in Java. We need...
- Java Hashmap Java HashMap is a map interface that allows us to...
Leave a Reply