Tuesday, 25 June 2013

java project

Working on a interesting java project airport management  send me suggestions to make it better
so recently ive been working on swings and they are really intresting so ill be uploading them tomorrow as soon as possible

Sunday, 23 June 2013

applets animation

hi guys i could'nt post gor last few days bcoz i was busy in a project so moving on
in previous one i told you about applets today i'll be telling you how you can perform basic level animation
it is done with the help of threads
threads are something required for
1-stop any function during execution time
2-decide speed for animation
3-suspend the programme
4-resume the programme
and many more but in this one we'll be using simple methods
Just run this programme and what it does
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.awt.*;
import java.applet.*;
public class gui extends Applet
{
Thread t=null;
int i;

public void paint(Graphics g)
{

g.drawOval(200,200,10,10);
g.drawOval(175,170,100,100);
g.drawOval(241,200,10,10);
g.drawArc(219,200,10,25,200,142);

g.drawArc(200,200,50,50,200,140);
try{

for(i=0;i<10;i++)
{
repaint();
t.sleep(50);
g.drawOval(220,250,10,i);
}


for(i=220;i<233;i+=2)
{
repaint();
t.sleep(50);
g.drawLine(i,223,i,230);

}}
catch(InterruptedException ab)
{
}
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

create itscorresponding HTML file and run it
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
<html>
<body>
<applet code = "gui.class",width="500",height="500"></applet>
</body>
</html>
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

Thursday, 20 June 2013

applet example

1-A simple example for how to use applets
this programme takes user input
name
date of birth
address
METHODS IN THE PROGRAMME
{
1-String a = JOptionPane.showInputDialog("enter your name");
IT IS USED TO DISPLAY AN INPUT DIALOGUE BOX ON SCREEN
2-g.drawString("name is", 25, 30);
IT IS A FUNCTION USED TO DISPLAY ON THE SCREEN 25,30 DECIDE THE
POSITION OF RESULT ON PAGE
}
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.awt.*;

public class apl  extends Applet{
String a,b,c;
public void init(){
 a = JOptionPane.showInputDialog("enter your name");
 b=JOptionPane.showInputDialog("enter your dob");
 c=JOptionPane.showInputDialog("enter your address");

}
public void paint(Graphics g)
{

g.drawString("name is"+a, 25, 30);
g.drawString("dob is"+b, 45, 30);
g.drawString("address is"+c, 65, 30);
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

2----save this file as" .html" file anr run it it will automatically inherit the class
now only java can not run a applet so you need to know a bit of html
<HTML>
<body>
<applet code="usr.class",width="500",height="500">
</applet>
</body>
</HTML>



html for applet

Creating an html programme to use applet


<HTML>
<Body>
<applet code="apl.class",width="500",height="500">
</applet>
</Body>
</HTML>

apl.class------------------- is the name of your class in the programme of java
width="500",height="500"--define the height and width of output

Applets intro

Guess what recently ive been working on java applets and it is some really cool stuff
So for the introduction part there are a few things you should keep in mind while
working with applets
1-import java.awt.*; package for appletsdont forget to import it
2-public class apl  extends Applet
here apl is name of your class and Applet is a inbuilt class
3-public void init()
this is also inbuilt method used for declairing every data type or what attributes the programme is going to have
4-public void paint(Graphics g)
this is also an inbuilt function used for printing things on screen
------------------------------------------------------------------------------------------------------------
These things would be more clear in our next post

Monday, 17 June 2013

Introduction to treads

I came across some intresting things like threads where you can perform more than one task at a time
There are many methods you can apply on threads but in this one i'll be showing you how to create a thread and how to run it
1- in this example we can se how threads can  be used it is a inbuilt class and we inherit it by using extends key word .Run is a function we dont need to call it it is automatically called
and we use our first function START used to start execution of thread making objects and calling are same

Saturday, 15 June 2013

Exception handling

started with new topic exception handling here is a simple example to start with
it is a division programme that divides two numbers and if denominator is 0 it shows error if catch exception is not there
1-
import java.io.*;
class se{
public static void main(String arg[])
{
DataInputStream dis=new DataInputStream(System.in);


try{
int a,b;
a=Integer.parseInt(dis.readLine());
b=Integer.parseInt(dis.readLine());
int c=a/b;
System.out.println(""+c);
}

catch(Exception e)
{
System.out.println("you cant do that");
}
}
}

Friday, 14 June 2013

string operations

1-if you want the string you have entered or user enters should come in upper or lower case do as follows
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.io.*;
class dp
{
public static void main(String arg[])
{
String a="welcome TO java";
System.out.println(a.toLowerCase());
System.out.println(a.toUpperCase());
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
2-if you want to check whether the value of string entered by user is equals to entered by you
Basically you are compairing two strings whether they are equal or not then do as follows
it could be done in two ways
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

class dro{
public static void main(String arg[])
{
String a=("what");
String b=("WHAT");
boolean c;
System.out.println(a.equals(b)); //checks for capitals and small letters
System.out.println(a.equalsIgnoreCase(b));// ignores capitals and small letters only compare words
}

}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
3-some really easy functions that you could just do by looking at them look below
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class combine{
public static void main(String arg[]){
String a= "this is combination of all";
System.out.println(a.lastIndexOf ('l'));//prints the value of  last position of  l in this case is 26
System.out.println(a.lastIndexOf ('l'));//prints the value of  first position of l
}}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
4-if you want to trim one of the blank spaces from front of string
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class combine{
public static void main(String arg[]){
String g=" what";
System.out.println(g.trim());//trims the space in front

}}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

String operations

1- to string is a function and it is too easy just look at the prog
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
 class ge{

   public static void main(String args[]){
      Integer x = 5;

      System.out.println(x.toString());  //prints 5
      System.out.println(Integer.toString(12)); //prints 12
   }
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Seriously telling i dont know why it is named to string when it just prints the integer of your choice instead of one initialised
2-'Startswith" this function just checks whether the string you have entered or user has entered begins with the word you specify or not
Ends with perform the exact opposite function

concider the example
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
 class vf{

   public static void main(String args[]){
      String a=("this is a good work");
    boolean b;
b=a.startsWith("this");//prints true on the screen
b=a.startsWith("this");// prints false on screen
b=a.endsWith("work");prints true on the screen
b=a.endsWith("this");
System.out.println(b);
System.out.println(b);
System.out.println(b);
System.out.println(b);
   }
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

string operations

1-Suppose you dont want to print whole of the string but a specified portion of it
THEN do as follows
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

class nn{
   public static void main(String args[]){
      String a = ("Welcome to specbug.blogspot.com");

     
      System.out.println(a.substring(10) );// prints letter after 10th position ie specbug.blogspot.com
     
   }
}

]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
2-if you want a particular area to be displayed ie a particular region then follow
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.io.*;

class Test{
    static void main(String args[]){
      String Str1 = new String("Welcome to specbug.blogspot.com");//target start
      char[] Str2 = new char[9];//character array

      try{
         Str1.getChars(2, 9, Str2, 0);//String.getChars(start,end,character array,target start)
       
         System.out.println(Str2 );//prints characters b/w 2nd and 9th position

      }catch( Exception ex){
       
      }
   }
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

string operations

Welcome guys in this one i'll be telling you about some more java functions


1 -How to find the length of the  string inputted by user or the one you input
YOU need to do nothing just call the [string.length ] function as below
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class f{
public static void main(String arg[]){
String b=new String("this is another string");
System.out.println(b.length());//output-22 because length of string is 21
}
}
2-Lets join or we can say cancatinate two or more string
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.lang.*;
import java.io.*;
class f
{
public static void main(String arg[]){
char a[]={'j','a','v','a'};

String s1=new String(a);
String s2=new String(s1);
String s3=new String(s2+s1);
System.out.println("combined= "+s3);//result=javajava
System.out.println(s1.concat(s2));
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
in this way u can join more than one strings 

String operations

So there are various Functions that we could perform on string so just keep looking at the examples given
Discription will be given along with
To begin with--

1- how to declare  a string and various ways
this just prints java on the screen
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.lang.*;
import java.io.*;
class f
{
public static void main(String arg[]){
char a[]={'j','a','v','a'};

String s1=new String(a);
String s2=new String(s1);
System.out.println(""+s1);
System.out.println(""+s2);
}}

]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

2-We can also combine different strings as follows
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.lang.*;
import java.io.*;
class f
{
public static void main(String arg[]){
char a[]={'j','a','v','a'};

String s1=new String(a);
String s2=new String(s1);
System.out.println(""+s1);
System.out.println(""+s2);
String s3=new String(s2+s1);
System.out.println(s3);
}}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
3- Lets see something more for example if we want only jav to be printed or av or va then see below
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
import java.lang.*;
import java.io.*;
class f
{
public static void main(String arg[]){
char a[]={'j','a','v','a'};

String s1=new String(a);
String s2=new String(s1);
String s4=new String(a,0,3);//(prints characters form 0-3)
System.out.println(""+s1);
System.out.println(""+s2);
String s3=new String(s2+s1);
System.out.println(s3);
System.out.println(s4);//output=jav
}}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
THATS ALL FOR NOW BUT CHECK MY NEXT POSTS FOR MORE AND LET ME KNOW IF THERE IS ANY PROBLEM

Thursday, 13 June 2013

Hey guys Sorry i cant update my blog yesterday due to some reason
But  i've been doing research work on "strings" and various operations on them
I"ll be uploading them n the evening so keep checking

Tuesday, 11 June 2013

Attempt Personnel interview

So i told you thingsyou should keep in mind during GD
In this one
i"ll be telling what to keep in mind during Personnel interview
So below are some points
1-Always knock before you enter
2-Knock twice and if the person does not listen just walk through
3-Never sit until and unless you are asked
4-If you are shaking hand with a male your shake should be strong if with a lady do it politely
5-Prepare atleast 6-7 things about your introduction
6-If you are telling your hobbies then you should know each and every thing about it
7-Never beg in front of any body
8-U should know atleast 4-7 of your weaknesses,and your strengths
And some more things you should keep in mind i'll be uploading Time to time these things
And try to over come your weaknesses and show this thing to your invigilator also that you are trying to improve it

Personnel development

Is java sufficient
Only learning java is not sufficient for your good job or placement
You should also know how to face GD sessions and PERSONNEL INTERVIEWS
So in this post i'll be telling you about some things you should know about interviews
I recently under went a gd session in which invigilator pointed out our mistakes and asked
us to avoid them
Below are few of them
1-Always keep your back straight while sitting and put your hands on your thies
2-Use only one hand to express your thoughts
3-Never interrupt any one while he/she is speaking but if it turns out to be a lecture hit your point
4-If some one started to speak before you u will have to be quiet and let him speak
5-Never directly oppose any one or disagree him
6-Act as a leader and ask those to speak who are not speaking
7-Look towards every one when you are speaking
8-Look towards the person who is speaking
9-Never get into a point to point arguement for long
10-Dont look towards invgilator when you speak until and unless he asks you a question
Keep these things in mind and you'll surely crack the Gd(group discussion)

some more examples

If you got the last one then you"ll be able to get this one also
Some more examples of packages1


Packages

Whats up guys i recenlty lernt something very interesting called a Package 
so basically what  a package is like u write your daily programmes same way
u write your pckages but the difference is the u dont run your packages you just compile
them and leve them NOTE when we are writing a package the methods or functions
or the classes created are not called that is you dont write the main function you just
create class its member functions and compile them The syntax is shown below

Monday, 10 June 2013

Interfaces

So in this one well be using functions
what we do is just define them in the interface and then their body is specified in the class
you might be thinking if we have to specify body in the class then why not function also
well i dont know why right now but as it is a feature so we just have to get use to it  and it might be used
further in java so just bear with me
here's a simple example to show what i am saying
1--
interface a{
public void rec();
}
class b implements a
{
int n=12345;
int reverse=0;
public void rec(){

while(n>0)
{
reverse = reverse * 10;
reverse = reverse + n%10;
n = n/10;
}
System.out.println(""+reverse);

}
}
class dd{

public static void main(String arg[]){

b object = new b();

object.rec();
}
}

Interfaces

So talking about interfaces it is just nothing but like classes it is defined with the symtax as follows

interface name of interface{
body
}
Talking about the body--
only  data types  declared as final can be used or declared in it other ones will not work and just believe me because i have tried it and so can you heres a example how it works
1-- simple program to find area of circle
 interface rocks{
final double pi=3.14;

}
class circle implements rocks
{
double a=0;
void shocks(int x)
{
a=pi*x*x;
System.out.println("area of circle is"+a);
}
}
class testing{
public static void main(String arg[])
{
circle object=new circle();
object.shocks(5);
}
}
like in classes we have to write extend keyword to inherit from other class
likeways here we write implements as you can see
So this was how you use data types in next one i'll show you how to use functions

Sunday, 9 June 2013

Packages and Interfaces

Hey guys wts up lately  i' ve been workin on something called INTERFACES and PACKAGES
so far i am good with interfaces but packages are creating a bit of problem but soon ill get to know them too
i ll be uploading the details and the programmes in the evening so keep checking

Saturday, 8 June 2013

I want u to note that what ever i write or explain is purely on practical playground or based on personnel experience or
practically implementation by me



so in this post ill be telling about static key word i just practiced it recently
so what does it do if u make a data type static(eg-static int;)  then it is allocated memory globally
globally means that u can use it in any of your function of that class
we can also make a function static(static function())
now a static function has some properties like
1- only static datatypes or variables can be used in it
2- it is called using class name
it would be more clear with an example
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
class astatic{
static void bstatic (int a, int b,int c){
c=a+b;
System.out.println(""+c);
}}
class cstatic{
public static void main(String arg[]){
astatic.bstatic(2,3,0);
}
}
the variables declared in static are automatically initialised as static
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
2--now lets use static datamembers in other class as this one does
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
class astatic{
static int d=2,e=1,f=0;
static void bstatic (int a, int b,int c){
c=a+b;
System.out.println(""+c);
}
void dstatic( ){
f=d+e;
System.out.println(""+f);
}
}
class cstatic{
public static void main(String arg[]){
astatic.bstatic(2,3,0);
astatic object=new astatic();
object.dstatic();
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]




In our last post there was concept of overloading
in this one i"ll be showing what is overriding
now what does it do
when you  inherit features of other class u inherit its functions and what so ever it contains
we can use the functions of the class from which we have inherited and change them (not their name but the task they perform) yeah just pick the function and copy it in other class and make changes in its code
just look at my code it explains what i mean
1----
this is just a simple one to show overriding
if u still dont get any thing comment below


class food
{
void eat()
{
System.out.println("thies is eat");
}
}
class duper extends food
{
void eat()
{
System.out.println("this is meat");
}
}
class fuper extends food
{
void eat()
{
System.out.println("this is veg");
}
}
class Simpleoverride{
public static void main(String arg[]){

food object=new food();
duper objec=new duper();
fuper obje=new fuper();
object.eat();
objec.eat();
obje.eat();


}
}
So this first one is a simple one to explain what overloading is
when i first herd of this term i was like OMG its gonna be tough just bcoz it sounded too scary OVERLOADING
but seriously its nothing its just makink more than one function with same name in same class
below is a easy example for your understanding
i am not going to run them bcoz they all are running so go run them your self  and if it creates a problem
comment and tell me

1----
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class a
{
void data(int a,int b){

System.out.println(""+a);
System.out.println(""+b);
}
void data(int a,int b,int c){

System.out.println(""+a);
System.out.println(""+b);
System.out.println(""+c);
}

}
class overload{
public static void main(String arg[])
{
a object=new a();
object.data(2,3);
object.data(2,3,4);

}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
STAY TUNED FOR MORE THERES LOT TO COME
So todays class was really interesting rather 1 topic was really interesting
That was of  packages create as many classes as many functions and just import them your in your main
when ever u want in any programme not in a particular 1
SOUNDS INTERESTING
SO today ill be uploading some programmes not of packages i"ll be uploading them later
but some more interesting stuff u should know about java
follow on in my next post for those programmes

Friday, 7 June 2013

starting with todays practical work ill be uploading it one by one as i am weak in todays topics
1 inheritence--- just a basic one further ill be moving  to its types
class base
{
void print()
{
int a=2,b=3,c;
c=a+b;
System.out.println(""+c);

}


}
class inherit extends base
{
void get()
{



}

}
class man
{
public static void main(String arg[])
{

inherit obj=new inherit();


obj.print();


}


}

Thursday, 6 June 2013

some more programmes made by me
1-
 enter student data using functions in different class
u can enter your roll no,class,and name
the gui is not so good bcoz my main focus was on the concept
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class student{
int a,b;
String c;

DataInputStream dis=new DataInputStream(System.in);

void getdata()
{
try{
a=Integer.parseInt(dis.readLine());
b=Integer.parseInt(dis.readLine());
c=dis.readLine();


}
catch(IOException io)
{}

}
void showdata()
{
System.out.println("roll no="+a);
System.out.println("class="+b);
System.out.println("name="+c);


}


}

class Studentdata{
public static void main(String arg[])
{
student object=new student();
object.getdata();
object.showdata();

}


}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

Enjoying the party didnt do any thing

Wednesday, 5 June 2013

Extra efforts increases complexity but still
A program to check divisibility by 3,5,7
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class Divi{
public static void main(String arg[])
{
System.out.println("press 1 to check divi by 3");
System.out.println("press 2 to check divi by 5");
System.out.println("press 3 to check divi by 7");
int a;
a=Integer.parseInt(arg[0]);
int b;
b=Integer.parseInt(arg[1]);
System.out.println("enter the number to be checked");
switch (a)
{

case 1:
if (b%3==0)
{
System.out.println("no is divi by 3");
}
else{
System.out.println("it is not divi");
}
break;
case 2:
if (b%5==0)
{
System.out.println("it is divi by 5");}
else{
System.out.println("it is not divi");
}
break;
case 3:
if (b%7==0){
System.out.println("it is divi by 7");}
else{
System.out.println("it is not divi by 7");
}
break;
}
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Wow programming was never so fun or i never gave it a try but what so ever it is feeling good
to make programmes for the first time
Going to start with todays homework 
I am uploading only those which i think i can forget in future


1-this one just finds the table of any number you enter
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class Table{
public static void main(String arg[]){

int a,b,c;
b=Integer.parseInt(arg[0]);
for(a=0;a<=10;a++){
c=a*b;

System.out.println("result"+c);
}

}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
2-this one finds the sum of n numbers
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class Ssum{
public static void main(String arg[])
{
int i,n,s=0;
n=Integer.parseInt(arg[0]);
for(i=0;i<=n;i++){
s=s+i;


}
System.out.println("sum ="+s);
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

3-this one took toooooooo long i kept messing with the logic
but finally i did it
so it helps find the result of power
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class Power{
public static void main (String args[]){
int a,b,c,d=1;
a=Integer.parseInt(args[0]);
b=Integer.parseInt(args[1]);
for(c=0;c<=b;c++){
d=d*a;
}
System.out.println("result="+d);
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
4-this one finds the factorial of num god i ve done this prog many times but i still keep forgetting when i start with it
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class Factorial{
public static void main(String arg[])
{
int a,b,c;
b=Integer.parseInt(arg[0]);
for(a=b;a<=b;--b)
{
System.out.println("here u go"+b);
}
}
}

]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
5-this one prints the sum of n numbers
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class Dum{
public static void main(String arg[])
{
int i,n,s=0;
n=Integer.parseInt(arg[0]);
for(i=0;i<=n;i++){
s=s+i;


}
System.out.println("sum ="+s);
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]









Another very hot day over finally uploading my work
it helped me understand those things that i could never
understand during 2 years of my college 
I did 15-16 of them because some were too easy 
so i left them

Tuesday, 4 June 2013

Completed the yesterdays work now over to some more programmes keep checking for the old ones
going to upload them in the evening
Got 25+ programmes for homework so cant update my blog right now but as soon as they are finished i m going to upload my work