Author Archives: Thomas Mani P

throw – throws

throw – throws Point of usage throw keyword is used inside a function. It is used when it is required to throw an Exception logically. void Demo() throws ArithmeticException, NullPointerException { // Statements where exceptions might occur. throw new ArithmeticException(); … Continue reading

Posted in Basic | Leave a comment

CALL BY VALUE – CALL BY REFERENCE

Call by value – call by reference Call by Value means calling a method with a parameter as value. Through this, the argument value is passed to the parameter. While Call by Reference means calling a method with a parameter as a reference

Posted in Basic | Leave a comment

STATIC – NON STATIC

Static – non static variables Static variables are shared among all instances of a class. Non static variables are specific to that instance of a class. Static variable is like a global variable and is available to all methods. Non static variable is like a local variable and they can be … Continue reading

Posted in Basic | Leave a comment

PURE -IMPURE METHODS

Pure function The return value of the pure func­tions solely depends on its arguments Hence, if you call the pure func­tions with the same set of argu­ments, you will always get the same return values. They do not mod­ify the … Continue reading

Posted in Basic | Leave a comment

break – continue – return – System.exit(0)

The break keyword is used to breaks(stopping) a loop execution, which may be a for loop, while loop, do while or for each loop. The break statement can also be used to jump out of a loop. for (int i = 0; i … Continue reading

Posted in Basic | Leave a comment

CharConvert

Write a program that reads a string and a character. Each occurrence of the given character (regardless of its case) is converted to opposite case. Continue reading

Posted in String | Leave a comment

ConsChange

shifts all the consonants of the word at the beginning followed by the vowels (e.g. spoon becomes spnoo and SPNoo Continue reading

Posted in String | Leave a comment

TheString

A class TheString accepts a string of a maximum of 100 characters with only one blank space between the words. Some of the members of the class Continue reading

Posted in String | Leave a comment

WORD PILE

WordPile is an entity which can hold maximum of 20 characters. The restriction is that a character can be added or removed from one end only. Continue reading

Posted in Array | Leave a comment

SMITH MUMBER

A smith number is a composite number, the sum of whose digits is the sum of the digits of its prime factors obtained as a result of prime factorization (excluding 1). Continue reading

Posted in number | Leave a comment