Overcoming them is what makes life meaningful I am enjoying Challenges
Monday, 16 December 2013
Sunday, 15 December 2013
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 fixed
You might have used this command "mvn install" and then you have imported this project in to the eclipse.
to solve this
1)Right-click on your project, select Maven -> Remove Maven Nature.
2)Open you terminal, go to your project folder and do “mvn eclipse:clean”
3)Right click on your Project and select “Configure -> Convert into Maven Project” This is the error to solve this use above steps.
string-pattern-matched-in-java.html
to solve this
1)Right-click on your project, select Maven -> Remove Maven Nature.
2)Open you terminal, go to your project folder and do “mvn eclipse:clean”
3)Right click on your Project and select “Configure -> Convert into Maven Project” This is the error to solve this use above steps.
Tuesday, 10 December 2013
string pattern matched in java
string pattern in java
public class RegexMatches {
public static void main( String args[] ){
// String to be scanned to find the pattern.
String line = "xxxx123@gmail.com";
String pattern = "@gmail.com";
if(line.endwith(pattern ))
{
sysout("Matched");
}else{
sysout("Not Matched");
}
}
}
public class RegexMatches {
public static void main( String args[] ){
// String to be scanned to find the pattern.
String line = "xxxx123@gmail.com";
String pattern = "@gmail.com";
if(line.endwith(pattern ))
{
sysout("Matched");
}else{
sysout("Not Matched");
}
}
}
boolean check in if in java
boolean isS
if (status) { //positive work } else { // negative work }
if (status) { //positive work } else { // negative work }
Monday, 9 December 2013
string is null or empty check in java
string null check in java
If we want to check weather string is empty or not then use the
String str ="null";
if(str != null && !str.isEmpty())
{
sysout("null");
}
else{
sysout("not null");
}
If we want to check weather string is empty or not then use the
String str ="null";
if(str != null && !str.isEmpty())
{
sysout("null");
}
else{
sysout("not null");
}
Sunday, 17 November 2013
Split string using regular expression in java
How Split string using regular expression in java
public class RegEX {
public static void main(String[] args) {
String pattern = "([\\s+])";
String test="Have Nice Day ";
for(String token : test.split(pattern))
System.out.println(token);
}
}
======================================
Result :
Have
Nice
Day
======================================
Subscribe to:
Posts (Atom)