Sie sind auf Seite 1von 3

some important terminologies: 1.

JDK Java Development Toolkit A list of commands required for developing, compiling, testing & executi ng java programs example: javac - for compiling java programs java - for executing java classes Platform independent Physical entity ( you can see its presence in the installed folder) 2. JRE Java Runtime Environment A list of library files required to run java class / programs These libraries are availble in the form of jar files (similar to .zip f ile) Platform dependent Physical entity ( you can see its presence in the installed folder) 3. JVM Java Virtual Machine This is the interpretor that runs the .class file on any platform This is platform dependent Logical entity ( you cannot see this in the folder) When you run the .class file using java command OS creates a logical process that name is JVM java command is the interpretor Is the file name and class name same? No Hello.java ======== Compilation unit or file name or source file name class Hi { } javac Hello.java java Hi Write a program to generate the following series: 100, 90, 80, .... 50 Hint: You can use for, while or do...while Write a program to find out the sum of the numbers 1+2+3+4+...+10 Write a program to print the following pattern if n=5, then 1 22 333 4444 55555 System.out.print()

the cursor will remain in the same line after printing System.out.println() the cursor will move to the next line after printing System.out.println() System.out.print("\n"); Print the multiplication table exactly as it is: int n=5; then 5x1=5 5x2=10 5x3=15 ... 5x10=50 1 The following pattern: 0 1 3 6 10 15 2 Modify the above program to print first 25 numbers in the above pattern 3 Program to find out the sum of the digits of a number int no=123; output: 1+2+3=6 Java Comments: 1. Single line comment // 2. Multi-line comment /* */ 3. Javadoc comment - this is for java program Write the program using "continue" 1 3 5 7 9 2 4 6 8 10

Das könnte Ihnen auch gefallen