Getting the String Encrypted

Java program to encrypt the text and then decrypt it

    import*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; import javax.swing.border.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; class Subs extends JFrame implements ActionListener { String s1,s2; int i; JButton bt; JButton bt1; Border b1; Border b2; char pchar; JFrame f; JPanel jp1,jp2; Container content;

Harmonic series in JAVA

Java program to print the harmonic series

  class harmonic { int i; int j; void calc() { for(int i=1; i<10; i++) { System.out.print(“1″); System.out.print(“/”); System.out.print(i); System.out.print(“+”); } } public static void main(String…s) { harmonic h=new harmonic(); h.calc(); } }

No Thumbnail

Java Program to print a specific series(Interview question)

  class divo { int i=1; int m=1; int result=1; divo() { for(i=1;i<7;i++) { m=2*i; result=result*m*(m+1); System.out.print(2*i); System.out.print(“/”); System.out.print(“(“+result+”=”+(m+1)+”!)”); System.out.print(“+”); } } public static void main(String…s) { new divo(); } }   NOTE: I was asked this question in an interview for internship in a

Queue in JAVA

Create a Queue in JAVA

    import*; class Queues { private int front,rear,size; private int q[]; Queues(int size) { this.size=size; q=new int[size]; front=rear=-1; } public void push(int n) { if(rear==(size-1)) { System.out.println(“No more space :P”); } else if((front==-1) &&(rear==-1)) { front=rear=0; q[front]=n; } else { q[++rear]=n; } showQueue();

Facebook Iconfacebook like buttonYouTube IconTwitter Icon