Wednesday, 4 December 2013

Unknown

Factorial of a number


/*
 This program shows how to calculate
 Factorial of a number.
 */

public class NumberFactorial {

    public static void main(String[] args) {
        int number = 5;
        /*
         * Factorial of any number is! n.
         * For example, factorial of 4 is 4*3*2*1.
         */
        int factorial = number;
        for (int i = (number - 1); i > 1; i--) {
            4

        }
        {
            factorial = factorial * i;
        }
        System.out.println("Factorial of a number is " + factorial);
    }
}
/*
Output of the Factorial program would be
Factorial of a number is 120
*/
Read More
Unknown

To Display the List of even numbers


public class ListEvenNumbers {

        public static void main(String[] args) {
               
                //define limit
                int limit = 50;
               
                System.out.println("Printing Even numbers between 1 and " + limit);
               
                for(int i=1; i <= limit; i++){
                       
                        // if the number is divisible by 2 then it is even
                        if( i % 2 == 0){
                                System.out.print(i + " ");
                        }
                }
        }
}

/*
Output of List Even Numbers Java Example would be
Printing Even numbers between 1 and 50
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50
*/
Read More

Tuesday, 3 December 2013

Unknown

How To Open Notepad Using Java Code

import java.util.*;
import java.io.*;
class Notepad {
public static void main(String[] args) {
Runtime rs = Runtime.getRuntime();
try {
rs.exec("notepad");
}
catch (IOException e) {
System.out.println(e);
}
}
}
Explanation:
getRunTime method is used to get reference of current RunTime object, exec method can be used to execute commands. You can also specify a file while opening notepad such as exec("notepad programming.txt") where xist in current working directory then a dialog box will be displaye'programming.txt' is the file you wish to open, if the file doesn't ed to create file. You can launch other applications using exec method, for is present in a directory which is not set in environment varia example exec("calc") will launch calculator application. If an application ble PATH then you can specify complete path of application. If you are still using Notepad for Java development it is recommended to switch
to some advanced text editor like Notepad++ or use a development IDE.
Read More
Unknown

Programming Jokes On RajiniKanth

    Rajnikanth can override a final function/variable.
  • Rajinikanth is the super class of all classes in Java (including Object class).
  • Rajnikanth can serialize static data members of any class.
  • Rajnikanth can serialize transient variables.
  • Rajnikanth can extend interfaces in classes.
  • Rajnikanth can “force” garbage collector to run..and guess what .. GC runs as higher priority thread n starts collecting garbage.
  • Rajnikanth can make a class abstract and final both at same time.
  • Rajnikanth never gets stackOverFlowexception.
  • Rajnikanth never faces any exception (Rather, Java can face RajnikanthException for any exception conditions) (Improved from earlier).
  • Rajnikanth never “try” any code, he directly “catch” the exceptions.
  • Rajnikanth can divide by zero. – (older one)
  • Rajnikanth can run Java byte code on “any” machine (Including but not limited to Java Virtual Machine).
  •  Rajnikanth Can use Pointers in JAVA
  • Rajnikanth access all PRIVATE data of any class
  • Rajnikanth use Operator Overloading in Java
  • Rajnikanth pass losts of Parameter using “Pass By Reference”
  • Rajnikanth is only person who use printf() in java
  • Rajnikanth can Declare function body in INTERFACE.
  • Rajnikanth can do MULTIPLE inheritance in JAVA straightfoward.
  • Rajnikanth Run Thread Program without Thread LIFECYCLE
  • In catch box if u write catch(Rajnikant e) it will catch all exceptions including EXCEPTION E
Read More
Unknown

Roles Of JRE

JRE
  • Java Runtime Environment (JRE) The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.
  • Java Runtime Environment contains JVM, class libraries, and other supporting files. It does not contain any development tools such as compiler, debugger, etc. Actually JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE. If you want to run any java program, you need to have JRE installed in the system
  • It's needed to run Java programs. You can't compile Java programs with it .For example: a regular computer user who wants to run some online games then will need JRE in his system to run Java programs.
  • JRE: is the execution environment for a java application.ie, it only support runtime dependencies including jvm for compiled program. If we want to compile a java program we need jdk. 



Read More
Unknown

Task or Functionality or Job Of JVM

JVM
  • It is a virtual machine that can execute Java bytecode. It is the code execution component of the Java software platform.
  • The Java Virtual machine (JVM) is the virtual machine that run the Java bytecodes. The JVM doesn't understand Java typo, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM. It's also the entity that allows Java to be a "portable language" (write once, run anywhere). Indeed there are specific implementations of the JVM for different systems (Windows, Linux, MacOS,), the aim is that with the same bytecodes they all give the same results.
  • As we all aware when we compile a Java file, output is not an ‘exe’ but it’s a ‘.class’ file. ‘.class’ file consists of Java byte codes which are understandable by JVM. Java Virtual Machine interprets the byte code into the machine code depending upon the underlying operating system and hardware combination. It is responsible for all the things like garbage collection, array bounds checking, etc… JVM is platform dependent.
  • The JVM is called “virtual” because it provides a machine interface that does not depend on the underlying operating system and machine hardware architecture. This independence from hardware and operating system is a cornerstone of the write-once run-anywhere value of Java programs.
  • There are different JVM implementations are there. These may differ in things like performance, reliability, speed, etc. These implementations will differ in those areas where Java specification doesn’t mention how to implement the features, like how the garbage collection process works is JVM dependent, Java spec doesn’t define any specific way to do this.
  • this actually means the byte code interpreter .It is platform dependent. For eg: in Windows platform the 'java.exe' or 'javaw.exe' precess is the jvm process.
Read More

Monday, 2 December 2013

Unknown

A Kid's Computer Problem

A Kid Calls The Help Desk To Complain About
Computer Problem..

Kid: When I Type Computer Password, it Just Shows Star Star Star Star [*****].
What is That joke? .

Help Desk: Dear Kid Those Stars Are To Protect You,
So That if a Person Standing Behind,
He Can’t Read Your Password….

Kid: Yeah Okay,
But Stars Appear Even When There is No One
Standing Behind Me
Read More
Unknown

When a Non IT Girl Marries an IT Proffessional

When a Non IT Girl Marries
an IT Proffessional
He: (Returning late from
work) "Good Evening Dear,
I`m now logged in."
She: Have you brought the
grocery?
He: Bad command or
filename.
She: But I told you in the
morning!
He: Syntax Error. Abort?
She: What about my new
TV?

He: Variable not found...
She: At least, give me your
Credit Card, I want
to do some shopping.
He: Sharing Violation.
Access denied...
She: Do you love me or do
you only love computers or
are you just being funny?
He: Too many parameters...
She: It was a great mistake
that I married an idiot like
you.
He: Data type mismatch.
She: You are useless.
He: It`s by Default.
She: What about your
Salary?
He: File in use ... Try later.
She: What is my value in
the family.
He: Unknown Virus 
Read More
Unknown

Engineering is like Public Toilet

Engineering Is like a....
.
.
.
.
typical Indian public toilet
.
.
People outside r desperate to go in &
people inside r dying to finish n come out......!! 
Read More
Unknown

Teachers Day Joke: Guru toh Guru Hota


10 Doctors, 5 Engineers aur 1 Teacher helicopter ki rassi pe latke hue the.

Pilot - Weight zyadaa hai, 1 Aadmi ko rassi choddni padegi!

Teacher - "Ye Qurbani hum denge kyunki hum teacher hain! Bajao taaliyaan!"

Sabhi Doctors aur Engineers taaliyaan bajaane lage!

Weight khud hi kam ho gaya!

MORAL: Doctor, bano ya Engineer, GURU toh aakhir GURU hi hota hai. 
Read More