tzbluebaby
BAN USER
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
using binary search
- tzbluebaby March 13, 2011Comment hidden because of low score. Click to expand.
0
of 0 vote
Polymophism is the ability to provide mutilple implementations of an action and select the correct implementation based on the surounding context.
For example , a class can have two versions of a method with different parameters ;
Or the same method can be defined both in base class and sub class ,the latter overriding the former for the instance of subclass.
Comment hidden because of low score. Click to expand.
0
of 0 vote
1 check memory ,disk usage
2 check SQL profile ,which activities might be a potential problem.
3 run "UPDATE_STATISTICS" command to update index
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Java CODE:
- tzbluebaby March 13, 2011import javax.swing.JOptionPane;
public class CheckPalindrome
{
public static void main(String[] args)
{
String s=JOptionPane.showInputDialog(null,"Enter a string ","Example",JOptionPane.QUESTION_MESSAGE);
String output="";
if(isPalindrome(s))
{
output=s+" is a palindrome!";
}
else
output=s+" is not a palindrome!";
JOptionPane.showMessageDialog(null,output,"The result",JOptionPane.INFORMATION_MESSAGE);
}
public static boolean isPalindrome(String s)
{
int low=0;
int high=s.length()-1;
while(low<high)
{
if(s.charAt(low)!=s.charAt(high))
return false;
low++;
high--;
}
return true;
}
}