Friday, August 16, 2013

java Program to Implement Overloading of Methods

 Program to Implement Overloading of Methods
class prnt
{
int a, a1, s, s1;
void show()
{
System.out.println("Father name: Mr.Roshan lal");
System.out.println("Mother Name: Mrs. Madhu Gupta") ;
}
}
class radha extends prnt
{
void get(int y)
{
a = 19;
s = y;
}
void show1()
{
System.out.println("\nstd name:Radha Garg");
System.out.println("age:" + a);
System.out.println("salary:" + s);
}
}
class money extends radha
{
void get(int x1,int y1)
{
a1 = x1;
s1 = y1;
}

void show2()
{
System.out.println("\nstd name:Money Garg");
System.out.println("age:" + a1);
System.out.println("salary:" + s1);
}
void shows()
{
show();
show1();
show2();
}
}
class overloading
{
public static void main(String z[])
{
money m = new money();
m.get(20,30000);
m.get(25000);
m.shows();
}
}

java Program to Implement Multithreading

Program to Implement Multithreading
import java.lang.*;
class aa extends Thread
{
public void run()
{
for(int i=0;i<4;i++)
{
try
{
if(i == 3)
{
sleep(4000);
}
}
catch(Exception x)
{ }
System.out.println(i);
}
System.out.println(" i finished ");
}
}
class bb extends Thread
{
public void run()
{
for(int i=0; i<4; i++)
{
System.out.println(i);
}
System.out.println(" ii finished ");
}
}

class cc extends Thread
{
public void run()
{
for(int i=0; i<4; i++)
{
System.out.println(i);
}
System.out.println(" iii finished ");
}
}
class multi_thread
{
public static void main(String arg[])
{
aa a1 = new aa();
bb b1 = new bb();
cc c1 = new cc();
a1.start();
b1.start();
c1.start();
}
}

java Program to Illustrate the use of Methods of Vector Class

 Program to Illustrate the use of Methods of Vector Class
import java.util.*;
class vctr
{
public static void main(String arg[])
{
Vector list = new Vector();
int l = arg.length;
for(int i=0; i<l; i++)
{
list.addElement(arg[i]);
}
list.insertElementAt("COBOL",2);
int size = list.size();
String lary[ ] = new String[size];
list.copyInto(lary);
System.out.println("List of Languages");
for(int i=0; i<size; i++)
{
System.out.println(lary[i]);
}
}
}

java Program to Illustrate the use of Methods of String Class

Program to Illustrate the use of Methods of String Class
import java.io.*;
class String1
{
public static void main(String arg[])
{
try
{
int n = 5;
int m = 8;
char s = 'n';
String str = new String(" Radha");
String str3 = new String(" Radha ");
String str4;
System.out.println(str.equals(str3));
String str1 = str.toLowerCase();
System.out.println("The String in Lower case:"
+ str1);
String str2 = str1.toUpperCase();
System.out.println("The String in Upper case:"
+ str2);
str4 = str1.trim();
System.out.println("The String after trimming:"
+ str4);
System.out.println("The length of String:"
+ str4.length());
str2 = str1.replace('h','d');
System.out.println("The repalced String" + str2);
System.out.println(str1.equals(str2));
System.out.println("The character at position 3:"
+ str2.charAt(3));System.out.println("The substring is:"
+ str2.substring(n));
System.out.println("The substring is:"+ str2.substring(n,m));
System.out.println("The Index of O:"+ str2.indexOf(s));
}
catch(Exception s)
{
System.out.println(s.getMessage());
}
}
}

Wednesday, August 7, 2013

java Program to Illustrate the use of Methods of StringBuffer Class

 Program to Illustrate the use of Methods of StringBuffer Class

import java.io.*;
import java.lang.*;
class Stringb
{
public static void main(String args[])
{
try
{
StringBuffer str=new StringBuffer("Radha Garg");
System.out.println("\n1.Length\n2.Capacity
\n3.Setlength\n4.Charat\n5.Setcharat
\n6.Append\n7.Deletecharat\n8.Substring
\n9.Substring1\n10.Insert\n11.Reverse");
System.out.println("Enter ur chioce");
DataInputStream ds = new DataInputStream(System.in);
int ch = Integer.parseInt(ds.readLine());
switch(ch)
{
case 1:
System.out.println("The length of the
string is:" + str.length());
break;
case 2:
System.out.println("The capacity of
String:" + str.capacity());
break;
case 3:
str.setLength(15);
System.out.println("Set length of String:"
+ str.length());
break;
case 4:
System.out.println("The character at 6th
position:" + str.charAt(5));
break;
case 5:
str.setCharAt(2,'u');
System.out.println("The string after
setting position is:" +str);
break;
case 6:
System.out.println("The string after
appending:" + str.append(" Sohni"));
break;
case 7:
System.out.println("The string after
deletion:" + str.deleteCharAt(7));
break;
case 8:
System.out.println("The substring is:" +
str.substring(2));
break;
case 9:
System.out.println("The subsstring2 is:" +
str.substring(3,8));
break;
case 10:
System.out.println(" The string after
insertion is:" + str.insert(6,'m'));
break;
case 11:
System.out.println("The string after
reverse is:" + str.reverse());
}
}
catch(Exception s)
{
System.out.println(s.getMessage());
}
}
}
Output:

JAVA Program to Handle In-built Exceptions

Program to Handle any Three In-built Exceptions
class checkExcept
{
public void add()
{
try
{
int y = 20,z = 0;
int x = y/z;
System.out.println(x);
System.out.println("working");
}
catch(ArithmeticException a)
{
System.out.println("error");
}
catch(SecurityException a2)
{
System.out.println("error");
}
catch(ArrayStoreException a1)
{ }
catch(Exception x)
{
System.out.println(x.getMessage());
}
finally
{
System.out.println("finaly");
}
}

public static void main(String a[])
{
checkExcept c = new checkExcept();
c.add();
}
}


Saturday, August 3, 2013

how to increase your pc speed

[Windows Experience Index] Re-run the assessment increases the pc performance..




Start> Right-Click on Computer> Properties

Click on the Windows Experience Index link (next to the rating)

You shall get further information about how the rating is calculated and down below you shall get the Re-run the assessment option.
 

This process will remove junk files ,  clean the cache, solve the registry problems, solve the clutter problems and increase your pc performance.
[important: don't detach the power while performing this process, the process will fail. If the process failed,then you can do it again....]

how to remove virus using cmd


Here some tips using batch line.

If the virus is running in your computer find the virus name first.
If you found it
type cmd on start menu.
Then type in the command line

taskkill /IM virusname.exe /F the IM and F should be capitalize.

This command will kill or stop the virus from running in your computer.

The next thing you do is to delete all virus but first you must find the path where the virus is located.

If you found it go to the virus path using cd command. For example the virus is in system32

you must type this "cd windows\system32"

then the prompt will be in system32 and it will look like this c:\windows\system32>_

then type attrib -r -h -s virusname.exe

this command will make the virus visible.

so type then erase or del virusname.exe

Thats it...

how to set video as desktop wallpaper

setting Video As Desktop Wallpaper

Labels: tricks corner


Ever wanted to set cool videos as your computers Desktop Wallpaper, then you came to right place.
Today in this post i will teach you how to set videos as your Desktop Wallpaper with a simple nice little trick and
small tool or software that mostly every one has installed on their computer or laptop. This trick works on  Windows Xp as
 well as it works on windows 7.
 Go through below post to learn this simple trick.

How to set video as desktop wallpaper ?
   1. Open VLC Media Player. If you don't have it download it frome Here.
   2. Then Go to Tools > Preference Or press CTRL + P and Selecet Video from left panel
   3. Then Choose DirectX video output from output dropdown list
      as shown in below image . 
  4. Save the changes ans restart VLC Media Player.
   5. Play any video you would like to set as your desktop wallpaper.
   6. Then click on Video and select DirectX Wallpaper from the dropdown list as show in below image.
   

   7. Now Minimize vlc player and you will see your video running on your desktop as wallpaper.
   8. If you want your default wallpaper back then uncheck DirectX Wallpaper from video dropdown list.
   9. Hope you like this simple trick .


how to use web browser as text editor


Simple Trick To Use Web Browsers As Text Editor

Labels: tricks corner
In this tutorial i will show you a simple and interesting trick to use your web browser such as Google Chrome or Mozilla Firefox as a simple text editor like Notepad. This trick works on all web browsers. So lets get started. How To Do ?
1 Copy below code in browser Url Section data:text/html,

2. Now Press Enter.
3. Now you can type anything as would do on any other text editor like Notepad.
4. To save your text file Press Ctrl + S and save it as anything.txt (.txt Is Must)

making a nameless folder in windows


Making Nameless Folder In Windows
Labels: tricks corner

Basically you can not make folder with no name on windows. This trick will allow you to make folder without any name. This trick works on any windows  operating system.

How To Make Nameless Folder
Before attempting this trick, try to make a folder with no name and you will fail to do so. This is what this trick will let you do. Below is screenshot of folder before and after doing this interesting trick.

1.    Make a New folder on desktop or where ever you want.
2.    Right click on this newly created folder and select Rename.
3.    Erase the text showing "New Folder".
4.    Now keep Pressing Alt (i.e alter key) and type 255. If you are on laptop then you need to enable your Num Lock and type from the highlighted number keys not from those below function keys.
5.    After that leave alt key and Press enter.
6.    Done you just created nameless folder.