This is a very basic method to sort an array works on swapping of adjacent elements if they are not in a order. we can sort array whether in ascending or descending order. suppose we have an array; here length of array tell us how many time comparison and swapping […]
Linear search using array in C
What are the basic elements and how to use them in C?
Identifiers: All the words that we will use in c are keywords or identifiers. keywords are predefined and can’t be changed by the users, While identifiers are used to give names to entities likes variables, arrays, functions and etc. There are some rules naming identifiers as: The name should consist […]
What is and how to use the Constructors in JAVA?
Why constructor is needed? It can be a slow process to initialize all variables of a class, each time when an object is created. Because the requirement of initialization is very common, JAVA allows objects to initialize themselves when they are created. This automatic initialization is performed through the use […]
What is and how to use classes in JAVA?
Arrays
Type Conversion and Casting
There are two types of conversion in Java as: Implicit conversion Explicit conversion Implicit Conversion: Implicit conversion is also known as automatic conversion. When one type of data is assigned to different type of variable then automatic type conversion will take place if the following conditions are met. both type […]
Data Types and Variables
How to use control statements in Java and their example
There are mainly three categories of control statement in Java as: Selection Statement Iteration Statement Jump statement § Selection Statement: There are two selection statements as: if statement: It is conditional branch statement. It can be used to route program execution through two different paths. Syntax: if(condition) { statement; […]