Saturday, April 6, 2013

Bracket Check program in Java

This post describes how to write a bracket check program in Java. Here also I use Stack class I used in previous post. The additional class is BracketCheck class.




Driver class should like this

public class Driv {

public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub

BracketCheck brc=new BracketCheck("}hgy{gh[yssr)))");
}

}

So, the output should like this :)






Reverse String in Java

Hi, In This post I'm going to tell you how to create a String Reverse program in Java
At first, notice some important facts
1.This program consist with three classes
2.I'm going to do String reverse using Stack






Next, the StringReverse class


finally, the driver class


I hope you  will get it :)
Then by running the driver class, output should like this 








Sunday, March 10, 2013

Terminate Process in Linux (using terminal)

This post describes how to terminate a process in Linux using terminal.
Step 01: type 'ps x' to find the process ID
You will see the set of process and related process IDs.



Step 02: find the process you need to terminate from the description.Then find the process ID of it. For example I need to terminate currently playing MP3. I found the relevant process ID is   '4186'.


Step 03: type 'kill' <space> process ID to terminate the process.In  this example I type
 'kill 4186'.



Now the process is terminated. :)