Trending ▼   ResFinder  

ICSE − Q & A

ICSE
Indian Certificate of Secondary Education (ICSE), New Delhi
+Fave Message

Ask a Question

Answer a Question!

ResFinder - Thousands of Practice Papers

// programme to find whether a string is palindrome or not? 
import java.util.*;
import java.io.*;

public class StringPalindrome
{
    public   void check()
    {Scanner sc=new Scanner(System.in);
    
      String s1;
      System.out.println(" enter a string");
      s1=sc.nextLine();
    
      StringBuffer a1=new StringBuffer(s1);
      StringBuffer a2=new StringBuffer((a1.reverse()));
      
      if(a1.equalsIgnoreCase(a2))
      {
         System.out.println(" the string is a palindrome ");
        }
        else
        {
            System.out.println(" the string is not a palindrome");
        }
    }
    public static void main()
    {
      StringPalindrome a=new StringPalindrome();
      a.check();
    }
}


i am getting this error:

/StringPallindrome.java:16: error: cannot find symbol
      if(a1.equalsIgnoreCase(a2))
             ^
  symbol:   method equalsIgnoreCase(StringBuffer)
  location: variable a1 of type StringBuffer
1 error

please tell what changes should i do in this programme?
asked by Sameed Hussain (sameed) 6 years ago
4
Give an example of data abstraction
asked by Nehal G (nehalg) 6 years ago
3

+ 1 more questions by nehalg  

System.out.println((int)(Math.random()*10)); what are the range of possible out comes
asked by Rtstud (mdarfath) 6 years ago
2

+ 2 more questions by mdarfath  

Today is World Water Day....Save Water Save Earth.
asked by ⚡The Flash⚡ (devanshu8) 6 years ago
1
What happens when we declare the access modifier of a class as final?
public final void main(){
....
asked by Siddhant Joshi (siddhant94) 6 years ago
2
Guys, Just a suggestion...
I have realized that the programs are always DEAD EASY and therefore our presentation is expected to be flawless. Not even a cancellation.
I would recommend you all to keep two pages per program so that you can complete the program in 1.5 page and the remaining half for variable table.
Now the question in most people's minds is 1.5? really? we easily finish our code in 1.
Here's the catch: After every 5 lines or so, leave a line.
The reason for this is how much ever you disagree(sorry for the bad grammar xD) you may always forget an initialization of some variable. This line may help you out. Also, before writing the program, briefly explain the logic you are applying in simple words to the examiner. There is a chance that he MAY get impressed by your unconventional Logic and MAY give you marks for the program in spite of minor errors for OUT OF THE BOX THINKING.
Finally for people who are damn scared for tomorrow: Why are you? Think about it. You just have completed 80% of your boards! Last 2 to go that's it. Java is a language. Programming is essay writing, friends! As long as your grammar is good, no one can steal those 60 marks from YOU. Think about how amazing the previous papers were, in order to comprehend how stunning tomorrow's paper will be.
DON'T PANIC IN THE EXAMINATION HALL. THE CHECKERS WILL PANIC AFTER SEEING YOUR FLAWLESS PAPER THINKING, "Where the hell can I cut his/her marks!!!!"
I KNOW YOU CAN DO IT.
All The Best,
Aameya Kulkarni.
asked by Aameya Kulkarni (aameyak) 6 years ago
7
What do you mean by the term FAKE in handball?
asked by Vaishnavi Kattimani (eleven) 6 years ago
2
Guys brace urself for a tough paper. Looking at the trend of the boards, they generally ask a tough paper after a drought of easy papers. Since 2017 and 16s were cakewalks, looks like we are in for a tough paper :)
asked by Jeff mckinley (chende) 6 years ago
3
in loop execution questions, do we count number of complete executions or all executions?
asked by Hatake Kakashi (jatintara) 6 years ago
3
How many times does the loop run?

do
                    {
                        System.out.println(c++);
                        if(c%10 == 0)
                            break;
                        }
                        while(true);
asked by Harsh Nawal (harsh104) 6 years ago
7

<< Prev

    Page 505    

Next Page >>

ICSE chat

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us