Functions Overview Function is a basic building block of a C program. Any C program can be assumed as a collection of several functions. Function is a block of code which has some name for identification. Key points about function
goto statement
goto statement The goto statement is used for unconditional jump from one part of the program to another part of the program. It is always suggested not to use goto statement as this reduces the readability of the program. Use
switch case control
switch case control instruction We studied earlier in decision control that how and when to use if, if-else. They are good enough to select one from the two available options. When choices are two, we can use if-else. Even if
Keyword continue
The keyword continue The keyword continue is used only in the body of loop. It is used to move control at termination condition in the case of while and do-while loop. continue is used in for loop to transfer control
Keyword break
The keyword break The keyword break is used only in: In the body of loop In the body of switch The keyword break is used in the body of loop to terminate execution of loop before completion of normal life
Iterative Control Instruction (Loops)
Loops Iterative control instruction is also known as repetitive control instruction or loop. Sometimes it is desirable to executed same statement again and again. This can be done with the help of loops There are three ways to implement loops
Decision Control Instruction
Decision Control Instructions Decision control instruction is also known as selection control instruction. C language provides three ways to implement this instruction: if if else Conditional operator if Following is the syntax of if statement: int main() { ..… …..
What is the default value of variable in Java?
Default value of variable in java Variables declared inside a class are known as member variables (static or non static). These variables are initialized with their default value depending on the type of variable. For example variable of type int
Why is the java main method static?
main method in java is static This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked via the class.
What is the difference between ArrayList and Vector in Java?
ArrayList vs Vector ArrayList Vector Not Synchronized and so not thread safe Synchronized therfore thread safe Fast in performance Slow as it is thread safe Introduced first in java version 1.2 Introduced first in java version 1.0 does not provide