Skip to main content

Posts

Showing posts from August, 2013

FACTORIAL OF A NUMBER USING RMI IN JAVA

CLIENT PROGRAM: import java.io.*; import java.rmi.*; public class client { public static void main(String args[])throws Exception { try { String s="rmi://"+args[0]+"/abc"; serverint f=(serverint)Naming.lookup(s); DataInputStream m=new DataInputStream(System.in); int n1=Integer.parseInt(m.readLine()); System.out.println("the factorial is"+f.fact(n1)); } catch(Exception e) { System.out.println(e); } } } INTERFACE PROGRAM: import java.rmi.*; public interface serverint extends Remote { int fact(int n)throws Exception; } IMPLEMENTATION PROGRAM: import java.rmi.*; import java.rmi.server.*; public class serverimpl extends UnicastRemoteObject implements serverint { public serverimpl()throws Exception { } public int fact(int n) { int i,c=1; for(i=1;i<=n;i++) { c=i*c; } ret...

creating simple graphics appletviewer java

import java.awt.*; import java.applet.*; import java.awt.event.*; //<applet code="Appletdemo" height=500 width=500></applet> public class Appletdemo extends Applet implements ActionListener {             String s;             Button b1,b2;             public void init()             {                         b1= new Button("Test");                         b2=new Button("circle");                         add(b1);                         add(b2);                         b1.addActionListener(this);              ...

List of 221 MS Word Short Cut Keys

Short Cut Key Word Command Description 1 Ctrl + Shift + A AllCaps Makes the selection all capitals (toggle) 2 Alt + Ctrl + 1 ApplyHeading1 Applies Heading 1 style to the selected text 3 Alt + Ctrl + 2 ApplyHeading2 Applies Heading 2 style to the selected text 4 Alt + Ctrl + 3 ApplyHeading3 Applies Heading 3 style to the selected text 5 Ctrl + Shift + L ApplyListBullet Applies List Bullet style to the selected text 6 Alt + F10 AppMaximize Enlarges the application window to full size 7 Alt + F5 AppRestore Restores the application window to normal size 8 Ctrl+B Bold Makes the selection bold (toggle) 9 Ctrl + PgDn BrowseNext Jump to the next browse object 10 Ctrl + PgUp BrowsePrev Jump to the previous browse object 11 Alt + Ctrl + Home BrowseSel Select the next/prev browse object 12 Esc Cancel Terminates an action 13 Ctrl+E CenterPara Centers the paragr...