Senin, 05 September 2016

What are methods in Java? How do they work?

In this article you will learn about Java methods. You will look at what is a method, how to create methods in a Java class, how to call a method, how to return a value from a method and more. Method: A method is a piece of code to solve a particular task. A method is analogous to functions in C and C++. Methods are defined inside a class. The syntax for creating a method is as shown below: The return_type specifies the type of value that will be returned by the method. The name of the method is specified by method_name. Every

The post What are methods in Java? How do they work? appeared first on Coding Security.


What are methods in Java? How do they work?
read more

What is java Virtual Machine? How does it work?

In this article we will look at Java Virtual Machine (JVM) which provides the run-time engine for bytecode generated by the Java compiler. We will look at JVM architecture and more. Before learning about JVM it is important to know about JDK (Java Development Kit) and JRE (Java Runtime Environment). Below figure shows the relationship between JDK, JRE, and JVM: JDK provides programmers with a set of tools (like javac, debugger, javap, appletviewer etc..) for developing Java programs. JDK includes JRE. JRE provides the run-time engine JVM along with the class libraries which contains the predefined functionality. Using JDK programmers

The post What is java Virtual Machine? How does it work? appeared first on Coding Security.


What is java Virtual Machine? How does it work?
read more

Minggu, 04 September 2016

How do constructors work in java

In this article we will look at constructors in Java. We will learn what is a constructor, use of a constructor in Java programs, characteristics of a constructor and different types of a constructor.   Constructor  A constructor is a special method which has the same name as class name and that is used to initialize the objects (fields of an object) of a class. A constructor has the following characteristics: Constructor has the same name as the class in which it is defined. Constructor doesn’t have a return type, not even void. Implicit return type for a constructor is

The post How do constructors work in java appeared first on Coding Security.


How do constructors work in java
read more

Every Library File and it’s function in C – Programming

Predefined / Library Functions A function is said to be a predefined function or library function, if they are already declared and defined by another developer. These predefined functions will be available in the library header files. So, if we want to use a predefined function, we have to include the respective header file in our program. For example, if we want to use printf function in our program, we have to include thestdio.h header file, as the function printf has been declared inside it. Some of the header files in C are: Some of the predefined functions available in

The post Every Library File and it’s function in C – Programming appeared first on Coding Security.


Every Library File and it’s function in C – Programming
read more

How to work with Loops in C – Programming

goto Statement Unlike other selection or branching statements that we have seen so far which branches based on a condition, the goto statement branches unconditionally. That is why the goto statement is also referred to as unconditional jump statement. There are two more unconditional branch statements in C. They are: break and continue. We have already seen the break statement inswitch statement. But both break and continue are extensively used inside loops. So, we will discuss about these two unconditional branch statements later. By using the goto branch statement, we can either skip some instructions and jump forward in the

The post How to work with Loops in C – Programming appeared first on Coding Security.


How to work with Loops in C – Programming
read more

How to work with arrays in C – Programming

Arrays In all the programs we have done until now, to store and operate on values we have used variables. But at a point in time, a variable can hold only a single value. For example, in the following syntax: int a = 10; we are able to store only 10 in the variable a, which is a single value. It is normal in programming to work with a list of values or a group of values at once. For such purposes, variables cannot be used. So, C language provides the construct array for holding multiple values at once. Definition:

The post How to work with arrays in C – Programming appeared first on Coding Security.


How to work with arrays in C – Programming
read more

Sabtu, 03 September 2016

How to work with strings in C – Programming

Strings A string is a collection of characters which is treated as a single data item. A group of characters enclosed in double quotes is known as a string constant. Some of the examples of string constants are: “hai” “hello world” “My name is suresh” In C programming, there is no predefined data type to declare and use strings. So, we use character arrays to declare strings in C programs. The common operations that can be performed on a string are: Reading and writing strings Combining strings together Copying one string to another Comparing strings for equality Extracting a portion

The post How to work with strings in C – Programming appeared first on Coding Security.


How to work with strings in C – Programming
read more