Java programming Remarks

The Java programming language is… • General-purpose: It is designed to be used for writing software in a wide variety of application domains, and lacks specialized features for any specific domain. • Class-based: Its object structure is defined in classes. Class instances always have those fields and methods specified in their class definitions. This is … Read more

Java Is Object-Oriented

To some, object-oriented programming (OOP) technique is merely a way of organizing programs, and it can be accomplished using any language. Working with a real object-oriented language and programming environment, however, enables you to take full advantage of object- oriented methodology and its capabilities of creating flexible, modular programs and reusing code. Many of Java’s … Read more

Why Learn Java?

Java as a language has significant advantages over other languages and other programming environments that make it suitable for just about any programming task. This section describes some of those advantages. Java Is Platform-Independent Platform independence is one of the most significant advantages that Java has over other programming languages, particularly for systems that need … Read more

Java’s Past, Present, and Future

The Java language was developed at Sun Microsystems in 1991 as part of a research project to develop software for consumer electronics devices—television sets, VCRs, toasters, and the other sorts of machines you can buy at any department store. Java’s goals at that time were to be small, fast, efficient, and easily portable to a … Read more

What Is Java?

Java was originally a programming language invented by Sun Microsystems, by James Gosling. Today Oracle owns Sun, and therefore Java too. Java is thus Oracle’s trademark. Over time Java has evolved into more than just a language. It is a full platform with lots of standard APIs, open source APIs, tools, a big developer community … Read more

Arrays of Structures & Unions in C

Since structures are data types that are especially useful for creating collection items, why not make a collection of them using an array? Similarly, we can create array of Unions. The following code snippet shows how to create an array of structures and access a particular structure element’s member. struct student { int rno; char … Read more

Union: Accessing Union Members & Nesting in C

To access union members we can use dot operator (.) between union variable and union member name as follows: <Union-Variable-Name>.<MemberAddress> For example, to access marks of union student we can do as follows: union student std2; std2.marks = 20; Now, the data member percentage of union student also contains the same value 20 but in … Read more

Union: Definition, Declaration & Initialization in C

Union, is a collection of variables of different types, just like a structure, however a union can only store information in one field at one time. This means, a union can be viewed as a variable type that can contain many different variables as members (like a structure), but only actually holds one of them … Read more

Nesting of Structures in C

A Structure can contain other Structure variables as members. This is called Nesting of Structures. For example address structure is a structure. We can define a nested structure called customer which contains address structure as follows: struct address { int house_number; char street_name[50]; int zip_code; char country[50]; }; struct customer { char name[50]; structure address … Read more

Initialization & Accessing Structure Members in C

C programming language treats a structure as a user-defined data type; therefore you can initialize a structure like a variable. Here is an example of initialize product structure: struct product { char name[50]; double price; } book = { “C programming language”, 40.5 }; In above example, we defined product structure, then we declare and … Read more