Write a function which calculates the sum of even Fibonacci numbers.
public static void main(String args[]) {
for(int i=1;i<22;i++)
System.out.print(sumofEvenFibonacci(i) + " ");
}
public static long sumofEvenFibonacci(int n) {
// add your code here.
return sum;
}
prints
0...
11/26/11
11/22/11
Code 2 Learn One year completion
Today Code 2 Learn Completed one year.. And in this 1 year, it has seen some incredible ups, here are stats :Code 2 Learn Website : Pageviews : 67,5000Code 2 Learn Alexa :India Ranking : 51,000 ( 900,000 )World Ranking : 931,772 (initially : 5,000,000)Code 2 Learn Facebook Page : 400+ fans.....
11/19/11
Java Graphics Tutorial - 1
As we all know that we can make games with the help of java libraries that provide us with the graphics needed for making them. So today I will be starting a very new section on Java Graphics. I had earlier made posts on How to make an income tax calculator.
To start with here are some prerequisites...
11/18/11
Java Certification (O1Z0-851) : uCertify
In today's world if you are an IT professional so you are bound to have certain certification to increase your value in the IT industry. So today I am going to review an uCertify Certification course for Java (O1Z0-851).
Before we proceed lets have an idea about uCertify. uCertify is one...
Java Tutorial : Identifiers, Keywords and Types
Identifiers :
In Java programming language, an identifier is a name given to a variable, class or method. Identifiers start with a letter, underscore(_) or dollar sign ($). The following characters can be digits. Identifiers are case sensitive and have no maximum length...
11/16/11
Java Tutorial : Exceptions in Java
An exception is a problem that arises during the execution of a program. An exception can occur for many different reasons, including the following:
A user has entered invalid data.
A file that needs to be opened cannot be found.
A network connection has been lost in the middle of communications,...
11/14/11
Static Keyword in Java
While you are programming you would want to use some class members independently of any object of that class. Normally a class member is accessed with the help of the object of that class. However, it is possible to create class members that can be used by itself. To create such a member,...
Multilingual SEO

Search Engine Optimization is very crucial for the success of any online business. With the help of SEO, you can get your website optimized in such a way that you receive good traffic inflow from...
11/12/11
H1 Tags in SEO
H1 tags are one of the most important part of SEO which is the header tag situated in body of a website. It can be termed as the most simple form of header found on a web page. Through h1 tags search...
Problem Set 3
The below questions are very interesting and amazing questions. So please do try it.
QUESTION 1
int a=5,*b=&a;printf("%d",a**b);...
11/11/11
5 Easy Ways to get Traffic from Facebook

This is my First Guest Post on Code 2 Learn. and my personal Blog is DailyTechTips for SEO and Wordpress Stuff.
No Doubt Facebook is the best Social Networking Site. It gets Millions...
Methods Explanation : Java Tutorial
A Java method is a collection of statements that are grouped together to perform an operation. When you call the System.out.println method, for example, the system actually executes several statements in order to display a message on the console.
Now you will learn how to create your own methods...
11/10/11
Problem Set Java
Predict the Output
Question 1
class Base {
public void Print() {
System.out.println("Base");
}
}
class Derived extends Base {
public void Print() {
System.out.println("Derived");
}
}
class Main{
public static void DoPrint( Base o ) {
...
11/8/11
Problem No.1
The below program is hideously slow. CAN YOU SPOT THE REASON?
public static void main(String args[]){
Long sum=0L;
for ( long i=0; i < Integer.MAX_VALUE; i++){
sum += i;
}
System.out.println(sum);
}
...
11/4/11
Reading and Writing File in Java
Java like other programming languages supports both reading and writing of files. For reading purpose we use FileReader and for writing we use FileWriter.
FileReader Class :
The FileReader class creates a Reader that you can use to read the contents of a file. Its two most commonly used constructors...
11/3/11
Public static void main(String args[]){} : Explained
public static void main(String args[]){
}
Now lets understand why do we write the above statement, the way it is written above.
Why not change it?
Before we move to the topic make sure you understand the Keyword Static, to learn about it here is our tutorial on Static Keyword in Java.
The...
Good Practices : Programming Tips Java
One of the Good practices while programming using Java is listed below.
Consider Static Factory Methods instead of Constructors
The normal way for a client to obtain an instance of itself is to provide a public constructor. But apart from this their is another technique which should be the...
Java Tutorial : What is a Class?
Java class is nothing but a template for object you are going to create or it’s a blue print by using this we create an object. In simple word we can say it’s a specification or a pattern which we define and every object we define will follow that pattern.
What does Java Class consist of :
When...