Java and Class Fundamentals

The General Form of a Class, When you define a class, you declare its exact form and nature.You do this by specifying the data that it contains and the code that operates on that data. A class’ code defines the interface to its data. A class is declared by use of the class keyword. The general form of a class definition is shown here:class classname {type instance-variable1;type instance-variable2;// ...type instance-variableN;type methodname1(parameter-list){// body of method}type methodname2(parameter-list){// body of method}//...

Adding Color in HTML

A collection of nearly 150 color names are supported by all major browsers.When you create a web page you will want to use different background and text colour's and to add images. This makes the site more attractive to visitors and generally makes the website look better. Take care not to make the text and background colour the same... :-0To add color you would add the following HTML code into the body of your text file. <body bgcolor = "#0000FF">Notice how instead of saying We have used some strange looking code....

Statements, At-rules, Rule Sets and Selectors in CSS.

A CSS style sheet is composed from a list of statements. A statement is either an at-rule or a rule set. The following example has two statements; the first is an at-rule that is delimited by the semicolon at the end of the first line, and the second is a rule set that is delimited by the closing curly brace }. @import url(base.css);h2 {color: #666;font-weight: bold;}An at-rule is an instruction or directive to the CSS parser. It starts with an at-keyword: an @ character followed by an identifier . An at-rule can comprise a...

Variables and Parameters in C#

A variable represents a storage location that has a modifiable value. A variable can be a local variable, parameter, field or array element.The stack and the heap are the places where variables and constants reside. Each has very different lifetime semantics. The stack is a block of memory for storing local variables and parameters. The stack automatically grows and shrinks as a function is entered and exited.static int Factorial (int x) { if (x == 0) return 1; return x * Factorial (x-1); }This method is recursive,...

Defining a Class with a Member Function using C++

First we describe how to define a class and a member function. Then we explain how an object is created and how to call a member function of an object. The first few examples contain function main and the GradeBook class it uses in the same file./Define class GradeBook with a member function displayMessage;Create a GradeBook object and call its displayMessage function.*/#include <iostream>using std::cout;using std::endl;// GradeBook class definition class GradeBook ...

Arrays In C

An array is a group of related data items that share a common name or An array is a data structure consisting of a group of elements that are accessed by indexing. In most programming languages each element has the same data type and the array occupies a contiguous area of storage.#include <stdio.h>/* count digits, white space, others */main(){int c, i, nwhite, nother;int ndigit[10];nwhite = nother = 0;for (i = 0; i < 10; ++i)ndigit[i] = 0;while ((c = getchar()) != EOF)if (c >= '0' && c <= '9')++ndigit[c-'0'];else...

Write a program in C-Sharp to demostrate Arrays.

An array represents a fixed number of elements of a particular type. The elements in an array are always stored in a contiguous block of memory, providing highly efficient access.An array is denoted with square brackets after the element type. Like,char[] vowels = new char[5]; // It declare an array of 5Square brackets also index the array, accessing a particular element by position: vowels [0] = 'a';vowels [1] = 'e';vowels [2] = 'i';vowels [3] = 'o';vowels [4] = 'u';Console.WriteLine (vowels [1]); //To print e.This prints...

What's New in C# 3.0

C# 3.0 features are centered on Language Integrated Query capabilities, or LINQ for short. LINQ enables SQL-like queries to be written directly within a C# program, and checked statically for correctness. Queries can execute either locally or remotely; the .NET Framework provides LINQ-enabled APIs across local collections, remote databases, and XML.C# 3.0 features include:Lambda expressionsExtension methodsImplicitly typed local variablesQuery comprehensionsAnonymous typesImplicitly typed arraysObject initializersAutomatic propertiesPartial...

The EMPLOYEE table in SQL.

A single set of a group of fields is known as a record or row. For example, to create a relational database consisting of employee data, you might start with a table called EMPLOYEE that contains the following pieces of information: Name, Age, and Occupation. These three pieces of data make up the fields in the EMPLOYEE table.The six rows are the records in the EMPLOYEE table. To retrieve a specific record from this...

Write a program in C-Sharp to find the sum of all the digits of a given number.

The problem here is to sum the digits of a give number for example,if the number x is input as 123 the result should be calculated as 1 + 2 + 3 = 6. To Implement this logic in C, C++, C-Sharp we should use the Modulo operator. For example..,using System;using System.Collections.Generic;using System.Text;namespace SumOfDig{class Program{ static void Main(string[] args) { long modulo,sum=0; Console.Write("Enter the Number:"); long number = long.Parse(Console.ReadLine()); while (number > 0) { modulo...

Write a program in HTML to demonstrate the use of basic tags.

HTML stands for "Hyper Text Markup Language".HTML is the bricks and mortar of the WWW. Without HTML the World Wide Web could not have become as important as it is today. HTML is a document formatting language common the all computers on the WWW. Html permits cross platform communication between Macs, Apples, SUNs, PCs and others to view a document in a similar way. Every webpage that you visit uses HTML in some way,...

What are Dr. Codd's 12 Rules for a Relational Database Model.

The most popular data storage model is the relational database, which grew from theseminal paper "A Relational Model of Data for Large Shared Data Banks," written by Dr. E. F. Codd in 1970. SQL evolved to service the concepts of the relational databasemodel. Dr. Codd defined 13 rules, oddly enough referred to as Codd's 12 Rules, for therelational model:A relational DBMS must be able to manage databases entirely through...

Introduction to SQL, A Brief History.

The history of SQL begins in an IBM laboratory in San Jose, California, where SQL was developed in the late 1970's. The initials stand for Structured Query Language, and the language itself is often referred to as "sequel." It was originally developed for IBM's DB2 product (a relational database management system, or RDBMS, that can still be bought today for various platforms and environments). In fact, SQL makes an RDBMS possible. SQL is a nonprocedural language, in contrast to the procedural or third generation languages (3GLs)...

Write a simple program using PYTHON.

Python is a powerful yet easy to use programming language developed by Guido van Rossum, first released over a decade ago in 1991. With Python, you can quickly write a small project. But Python also scales up nicely and can be used for mission-critical, commercial applications.Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in...

Wrate a program in Java Script to demonstrate Java Script Execution.

In early December 1995, just prior to the formal release of Navigator 2, Netscape and Sun Microsystems jointly announced that the scripting language thereafter would be known as JavaScript. Though Netscape had several good marketing reasons for adopting this name, the changeover may have contributed more confusion to both the Java and HTML scripting worlds than anyone expected.The JavaScript language, working in tandem with related browser features, is a Web-enhancing technology. When employed on the client computer, the language...

Write a program in CSS to demonstrate the use of Style Element.

Cascading Style Sheets were created to provide a powerful, yet flexible means for formatting HTML content. CSS works much like style sheets in a word processing program—you define a“style” that contains formatting options that can be applied to document elements.For example, consider the following code:<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”“http://www.w3.org/TR/html4/strict.dtd”><html><head><title>A Sample Style</title><style type=“text/css”>h1 { color: Red; }</style></head><body>...Note...

Write a program in PHP to display "Hello, World !" message.

PHP is an excellent choice for Web programming. It has many advantagesover other languages, including other Web-oriented languages. To get avery general understanding of how the common Web programming languagescompare, let’s compare them. ASP is Microsoft’s Web programming environment. (It’s not a languageitself because it allows the programmer to choose from a few actual languages,such as VBScript or JScript.) ASP is simple, but too simple for programsthat use complex logic or algorithms. Tip:: An algorithm is a formula-like...

Write a program in C-Sharp to generate E-Bill using Switch Case.

The switch statement is a control statement that handles multiple selections and enumerations by passing control to one of the case statements within its body as the following example:int caseSwitch = 1;switch (caseSwitch){case 1: Console.WriteLine("Case 1"); break;case 2: Console.WriteLine("Case 2"); break;default: Console.WriteLine("Default case"); break;}Control is transferred to the case statement which matches the value of the switch. The switch statement can include any number of case instances, but no two case statements...

Write a program in C-Sharp to demostrate 'TYPECASTING'.

'Typecasting' is one of the methods used in programming. The name given to transforming one type into another. There are two types of casting that can be performed on data types, implicit and explicitImplicit Typecas:Implicit casting is performed by the compiler when there is no possible loss of data. This is when a smaller data type is copied into a larger data type - e.g., converting a 16-bit short to a 32-bit integer value. We could also say, implicit casting is used when casting from a basic type to a more general one. Therefore...

Write a program in C-Sharp to evaluate an equation.

In C#, Console.WrilLine(""); is like printf() function in C. There are three syntax method a programmer can choose to display his result and they are,Console.WriteLine("Hello, World"); //Normal Method.//Below is the Concatenation Method.Console.WriteLine(" The Sum Of "+a+" + "+b+" = "+c);//Last Method.Console.WriteLine("Sum Of {0} + {1} = {2}");Let us now see, How to evaluate an expression like this,( a + b ) * c---------------- 4 * dusing System;using System.Collections.Generic;using System.Text;namespace prog1{ class Program...

Write a program in C-Sharp to display "Hello World" message.

The .NET Framework supports multiple languages such as Visual Basic, C#, J#, and so on.C# has emerged as one of the most powerful object-oriented programming language. It implements all the object-oriented concepts , such as encapsulation, inheritance, polymorphism, and bstraction. However, there are certain things that differentiate it form C++. For instance, C# does not support multiple inheritance in classes, whereas C++ does.Being a .NET language, C# has access to the classes defined in the .NET Framework and to the unique...

Write a program in JAVA to preform Arithmetic Operation.

The Arithmetic Operation are Addition, Multiplication, Division, Subtraction. It is demonstrated below using java./* Arithmetic Operation Using Java */class ArithOp {public static void main(String args[]) { int num1,num2,Add,Mul,Div,Sub;num1 = 200;num2 = 100;System.out.println(" This is num1: "+num+" and num2: "+num2);Add = num1 + num2;Mul = num1 * num2;Div = num1 / num2;Sub = num1 - num2;System.out.println("Addition =" +Add);System.out.println("Multiplication =" +Mul);System.out.println("Division...

Write a program in JAVA to display a string.

The descriptions that follow use the standard java 2 SDK ( Software Development kit), which is available from Sum Microsystems. Click here to download . The First thing that you must learn about java is that the name you give to a source file is very important. Therefor, class name and program name should be same./*This is a simple java program.*/class Example { //Your program begins with a call to main().public static void main(String args[]) { System.out.println("This is a simple Java Program."); }}Output:This is a...

Write a program to obtain average of two numbers.

Here the compile reads two inputs at the run time and perform the average. Its a simple logic to perform average of two numbers.#include <iostream.h>int main(){float number1, number2, sum,average;cout << "Enter two number: ";cin >> number1;cin >> number2;sum = number1 + number2;average = sum/2;cout << "Sum =" << sum <<"\n";cout << "Average =" << average <<"\n";return 0;}Output:Enter two numbers: 6.5 7.5Sum = 14Average =...

Write a program to print a string using C++.

C++ is an Object-Oriented Programming Language. C++ is an extension of C with a major addition of the class construct feature Simula97. The most important facilities that C++ adds on to C are Classes, inheritance, function, overloading, and operator overloading. The object-oriented features in C++ allow programmers to build large programs with clarity, extensibility and ease of maintenance, incorporating the spirit and efficiency of C.#include <iostream.h> // include header fileint main(){cout << "Welcome To C++.\n";...
 

About Me

It's Me!Hi, I'm Moinuddin. I'm a Software Engineer at WIPRO working on Microsoft .NET Technology. I'm interested in a wide range of technology topics, mainly Microsoft including Windows Azure, WCF, WPF, Silverlight and any other cool technology that catches the eye.

Site Info

ProjectCSharp.com is mainly about demonstrating real time examples in different technologies like ASP.NET, WCF, WPF, Silverlight, Azure etc..,

Followers

Help Links

Project CSharp (C#) Copyright © 2011. All Rights Reserved.