To get number of words in string u can simply split that string by space. int[] words = string.split(" "); int noofwords = words.length; after getting number of words, loop the words and use reverse logic.
Regards Vipul.
To get number of words in string u can simply split that string by space. int[] words = string.split(" "); int noofwords = words.length; after getting number of words, loop the words and use reverse logic.
Regards Vipul.
At Caine c=new Caine(); Animal c1=new Caine(); Pisica p=new Pisica(); These 3 statements wont work. As you can see, your program does not have no-arg constructor. when you dont write any constructor, then compiler will include a default no-arg constructor. If you are explicitly writing a constructor then default constructor wont be added. You have to write your own default no-arg constructor. Then the above lines will run successully.
Regards Vipul