What is difference between int and const int& in C/C++?

Smita Kapse
Updated on 30-Jul-2019 22:30:25
Here we will see what are the differences between int and const_int& in C or C++.The int is basically the type of integer type data. And const is used to make something constant. If there is int& constant, then it indicates that this will hold the reference of some int type data. This reference value is constant itself. So the const is redundant. The compiler may return warning or some error.The const int& is same as int const&. So this refers to a constant integer. The integer cannot be modified through the reference.

What do we need to do to join Indian Army?

Sashi K
Updated on 30-Jul-2019 22:30:25
The army is one of the noblest professions. Interestingly you can join army anytime, with any minimal qualification as 10th, 12th, Diploma, graduation and more. One can join the army through NDA or through NCC or through recruitment by technical service commission.You can choose to serve a complete tenure opting a permanent service till you retire or serve for 10 - 15 years and then quit.

Temporary (temp) register in 8085 Microprocessor

Ankith Reddy
Updated on 30-Jul-2019 22:30:25
Temporary register is also an 8-bit register which the programmer can’t access at all. It is temporarily stored inside 8085 microprocessor which is 8 bit operand to the instruction set. For example, when the fetching of instructions “MVI M, 34H” is done the instruction register IR register will receive the opcode for MVI M, and the Temp register receives 34H.The operations of arithmetic and logical sequence carried out involves two operands, among which one is operand is provided by the accumulator, and the other operand is provided by the Temp register. For example, in the addition process the instruction to ... Read More

How to use Bar chart graph in android?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25
This example demonstrates How to use Bar chart graph in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Open build.gradle(module level) and add library dependency.apply plugin: 'com.android.application' android {    packagingOptions {       exclude 'META-INF/proguard/androidx-annotations.pro'    }    packagingOptions {       exclude 'META-INF/DEPENDENCIES'       exclude 'META-INF/LICENSE'       exclude 'META-INF/LICENSE.txt'       exclude 'META-INF/license.txt'       exclude 'META-INF/NOTICE'       exclude 'META-INF/NOTICE.txt'       exclude 'META-INF/notice.txt'       ... Read More

Search a value in JavaTuples Quartet class

Samual Sam
Updated on 30-Jul-2019 22:30:25
To search a value in JavaTuples Quartet class, you need to use the contains() method.Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following package −import org.javatuples.Quartet;Note − Steps to download and run JavaTuples program. If you are using Eclipse IDE to run Quartet Class in JavaTuples, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar file.The following is an example −Exampleimport org.javatuples.Quartet; public class Demo { public static void main(String[] args) ... Read More

Please explain lifecycle of a JSP

Samual Sam
Updated on 30-Jul-2019 22:30:25
A JSP life cycle is defined as the process from its creation till the destruction. This is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet.Paths Followed By JSPThe following are the paths followed by a JSP −CompilationInitializationExecutionCleanupThe four major phases of a JSP life cycle are very similar to the Servlet Life Cycle. The four phases have been described below −JSP CompilationWhen a browser asks for a JSP, the JSP engine first checks to see whether it needs to compile the page. If the page has never been compiled, ... Read More

What is the use of tag in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The tag formats a URL into a string and stores it into a variable. This tag automatically performs URL rewriting when necessary. The var attribute specifies the variable that will contain the formatted URL.The JSTL url tag is just an alternative method of writing the call to the response.encodeURL() method. The only real advantage the url tag provides is proper URL encoding, including any parameters specified by children param tag.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultValueBase URLYesNonecontext/ followed by the name of a local web applicationNoCurrent applicationvarName of the variable to expose the processed URLNoPrint to pagescopeScope of ... Read More

LocalDate withMonth() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25
An immutable copy of a LocalDate with the month altered as required is done using the method withMonth() in the LocalDate class in Java. This method requires a single parameter i.e. the month that is to be set in the LocalDate and it returns the LocalDate with the month altered as required.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main { public static void main(String[] args) { LocalDate ld1 = LocalDate.parse("2019-02-15"); System.out.println("The LocalDate is: " + ld1); ... Read More

IntStream boxed() method in Java

Arjun Thakur
Updated on 30-Jul-2019 22:30:25
The boxed() method of the IntStream class returns a Stream consisting of the elements of this stream, each boxed to an Integer.The syntax is as follows.Stream boxed()At first, create an IntStreamIntStream intStream = IntStream.range(20, 30);Now, use the boxed() method to return a Stream consisting of the elements of this stream, each boxed to an Integer.Stream s = intStream.boxed();The following is an example to implement IntStream boxed() method in Java.Example Live Demoimport java.util.*; import java.util.stream.Stream; import java.util.stream.IntStream; public class Demo {    public static void main(String[] args) {       IntStream intStream = IntStream.range(20, 30);       Stream s = ... Read More

Get the storage size of a database in MongoDB?

Anvi Jain
Updated on 30-Jul-2019 22:30:25
To get the storage size of a database in MongoDB, use the stats() method.At first, check the current database with the help of the following query −> db;The following is the output −testHere is the query to get the storage size of the database in MongoDB −> db.stats()The following is the output displaying the stats including the storage size −The following is the output −{    "db" : "test",    "collections" : 114,    "views" : 0,    "objects" : 391,    "avgObjSize" : 83.0076726342711,    "dataSize" : 32456,    "storageSize" : 3211264,    "numExtents" : 0,    "indexes" : 120,    "indexSize" : 2494464,    "fsUsedSize" : 126172377088,    "fsTotalSize" : 199229435904,    "ok" : 1 }
Advertisements