After building basics in java ,now its
time to pack your thoughts and come in the world of arrays.
you have already
wanted to learn arrays but due to some way or another you didn't do
that.your.probably your instructor or your friends call you dumb who can not
learn arrays.so here is goes THE MAKING OF ARRAYS
An array is like a tray of cups.
Steps
to declare an array.
step 1. Declare an
int array variable...
.
How to learn java easily?
Thursday, 18 April 2013
so this is the basic thought come in the mind of most people who are going to learn java or want to make this language as a profession.the first thing you need to understand that java is not a language which you can learn just by writing some codes given by your teacher or practicing some books example this is a language which need to be understand by heart ,to achieve greater goals you have to start early...
more examples on basics of java
Thursday, 18 April 2013
class Example
{
public static void main(String args[])
{
char ch; ch = 'X';
System.out.println("ch contains " + ch);
ch++; // increment ch
System.out.println("ch is now " + ch);
ch = 90; // give ch the value Z
System.out.println("ch is now " + ch);
}
}
Predicted Output: ch is now X ch is now Y ch is now Z
*********************************************************
control...
Famous programs in java
Thursday, 18 April 2013
Fibonacci program
class fib
{
public static void main(String[] arg)
{
int i,a=0,b=0,c=1;
int n=8;
System.out.println("fibonacci series"+n);
for(i=1;i<=n;i++)
{
a=b;
b=c;
c=a+b;
System.out.println(c);
}
}
}
********************************************************
armstrong numbers
class...
Logic table program in java
Thursday, 18 April 2013
Make a program which creates a sort of truth table to show the behaviour of all the logical operators mentioned. Hints:
You need two Boolean type variables which you will initially set both to false
Use character escape codes to tabulate the results
The following program can be used as a guide:
class LogicTable
{
public static void main(String args[])
{
boolean p, q;
System.out.println("P\tQ\tPANDQ\tPORQ\tPXORQ\tNOTP");
p...
examples of basic program in java
Thursday, 18 April 2013
class Example
{
public static void main(String args[])
{
int iresult, irem;
double dresult, drem;
iresult = 10 / 3;
irem = 10 % 3;
dresult = 10.0 / 3.0;
drem = 10.0 % 3.0;
System.out.println("Result and remainder of 10 / 3: " + iresult + " " + irem);
System.out.println("Result and remainder of 10.0 / 3.0: " + dresult + " " + drem);
}
}
Predicted Output: Result and Remainder of...
how to compile and run java programs
Thursday, 18 April 2013
you have to set path first---
for this
click on Mycomputer->properties->advanced->environmentvariables->pselect new paste the url of bin file C:\Program Files\Java\jdk1.7.0\bin in path and click okk.
then write first the program given below in a note pad
class Example
{
public static void main(String args[])
{
int var1; // this declares a variable
int var2; // this declares another...
My first java program
Thursday, 18 April 2013
Welcome all the geeks and nerds who want to develop some huge applications,all the college students,school goings and those who want something interesting in life.
so here is your first program..............
don't be upset if you don't know data structure and c,java is a language which you can learn easily only by entertaining yourself and the world ,you have to know only the basics.
here is a program----------------
.
...
Subscribe to:
Posts (Atom)