We have nothing against photo editing software. Really. But sometimes, in quiet moments, we start to think about what it would be like if we didn't have our hard drives full of software - how fast
Windows 2000/XP users may set their path by right-clicking on 'My Computer' and selecting 'Properties'. Under the 'Advanced' tab, there is a button that allows you to set the 'Environment variables'. Click on this and alter the 'Path' variable so that it also contains the path to the Java executable. For example, if you have installed Java in c:\jdk and your path is currently set to C:\WINDOWS\SYSTEM32, then you would change your path to read C:\WINDOWS\SYSTEM32;c:\jdk\bin When you open a new command prompt, it will reflect these changes and allow you to run java programs by typing "java". If you have installed the SDK, then you will also be able to run "javac" to compile stuff.
Windows 95/98/ME users may find that their path variable is stored in a different place. Edit the c:\autoexec.bat file and add the following line at the end: SET PATH=%PATH%;c:\jdk\bin (This also assumes that you have installed Java in c:\jdk)
Linux, UNIX, Solaris, FreeBSD users must set their PATH variable to point to where the java binaries have been installed. Please refer to your shell documentation if you have trouble doing this. For example, if you use bash as your shell, then you would add the following line to the end of your .bashrc: export PATH=/path/to/java:$PATH
JVM : Have you ever seen a software to install JVM ? NO ... Because you cant install it . Its considered to be subpart of JRE. Engineers at sun say its hypothetical Java engine that reads and run byte code.
JRE : = JVM + everything needed to run java program ( or should i say class file )
JDK : = JRE + extra tools needed to make java progran. see figure below.
The "JDK" is the Java Development Kit. I.e., the JDK is bundle of software that you can use to develop Java based software. The "JRE" is the Java Runtime Environment. I.e., the JRE is an implementation of the Java Virtual Machine which actually executes Java programs.
Typically, each JDK contains one (or more) JRE's along with the various development tools like the Java source compilers, bundling and deployment tools, debuggers, development libraries, etc.
The Scanner class is a class used for "scanning" primitive types and Strings. It can be used to get input from an InputStream, to parse through a String of text or to read from a file.
Parsing Through a String The constructor that we will be using from the Scanner class is:
Constructor Description
Scanner(String source) // Constructs a new Scanner that produces values scanned from the specified String.
The methods that we will be using from the Scanner class are:
nextInt() //Scans the next token of the input as an int.
hasNextInt() //Returns true if the next token in this scanner's input can be interpreted as an int value in the default radix using the nextInt() method.
Friday, June 12, 2009
These are the Java IDE for linux.
1. Amy
2. AnyJ
3. VioSoft Arriba
4. BlueJ
5. Chicory
6.Omnicore Software's CodeG
7. IBM's Eclipse 8. Elixir
9. FreeBuilder
10. Ginipad
11. IntelliJ's
IDEA
12. Jasmine
13. Borland's JBuilder aka JavaBuilder
14. JCreator
LE or Pro
15. BulletProof's JDesignerPro
16. Jedi
17. Jedit 18. Jipe
19. JJTop
20. JOODA
21. Allaire's Kawa
22. ProSyst's mBedded Builder
23. NetBeans Developer 24. Data Representations's Simplicity and Simplicity Professional
25. Wind River Systems / TakeFive Software's SNiFF+ and SNiFF Penguin
26. CYGNUS's Source Navigator with the Insight debugger
27. Sun One
Studio 4 (formerly Forte)
28. SwingSoft's SwingBuilder
29.
TogetherSoft's Together
30. VIDE (for C++ and Java)
31. IST's Visaj
32. Compuware's OptimalJ
33. IBM's VisualAge Java
34. Visual
Paradigm
35. IBM's WebSphere Application Developer
in this game computer generate a number but we can't see it. we have 7 times to guess the number each time we get some marks there are hint to guide you to answer
if you guess first time we give u 21 marks for second time 18 marks
like that marks will be reduced
so enjoy it.....:-)
import java.util.Random; import java.util.Scanner; class Guess { public static void main (String [] args) { Random randomNo= new Random(); Scanner input= new Scanner(System.in); int rand; int exit; boolean play=true; // Set play True becoz play must continue boolean won=false; int turn=0; while (play==true)// check play continue or want to exit { System.out.print("IF YOU CAN..... (Guessing game{Try to guess the computer generated Number})"); rand=randomNo.nextInt(100);// Generate Random number for (int i=1 ; i<=7 ; i++) { System.out.print("Enter Your Guess : "); int guessVal=input.nextInt();//Give chance to input user turn=i; if (guessVal==rand) // Check Guess value is equal to Random number { won=true; // if Guess is correct User is win break; } else if (guessValrand) // if random number less than guess number System.out.println("Try a number less than "+guessVal); } if (won=true) // if user win calculate marks { int marks=0; if (turn==1) marks=21; else if (turn==2) marks=18; else if (turn==3) marks=15; else if (turn==4) marks=12; else if (turn==5) marks=9; else if (turn==6) marks=6; else if (turn==7) marks=3; else if (turn==8) marks=0; System.out.println("Your mark is : " + marks); System.out.print("If You want to Play Again Enter 1, Quit Enter 0 : "); exit=input.nextInt(); // if user enter 1 play is continue otherwise stop the game if (exit==0) play=false; } else { System.out.println("Game is Over"); System.out.print("If You want to Play Again Enter 1, Quit Enter 0 : "); exit=input.nextInt();// if user enter 1 play is continue otherwise stop the game if (exit==0) play=false; } }