Category Archives: Basic
RECURSION – ITERATION
Recursion refers to a situation where a function calls itself again and again until some base condition is not reached. A program is called recursive when an entity calls itself. It is comparatively slower because before each function call the … Continue reading
CHECKED – UNCHECKED EXCEPTIONS
Checked exceptions are checked at compile-time. It means if a method is throwing a checked exception then it should handle the exception using try-catch block or it should declare the exception using throws keyword, otherwise the program will give a … Continue reading
FUNCTION PROTOTYPE – DEFINITION
function prototype – definition Function prototype is the declaration of a function which specifies about the return type,function name as well as the data types of the parameters that are passed to the function. General syntax of function prototype returntype … Continue reading
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
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
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
PURE -IMPURE METHODS
Pure function The return value of the pure functions solely depends on its arguments Hence, if you call the pure functions with the same set of arguments, you will always get the same return values. They do not modify the … Continue reading
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
Java Programming
Java is an object-oriented, class-based, concurrent, secured and general-purpose computer-programming language. Continue reading