1-Compiler gets sourcecode and produces bytecode.
2-bytecode is machinecode instructions for the JVM.
3-bytecodes are stored in .class files.
4-JVM does Garbage Collection.
5-at runtime JVM loads the bytcodes, checks them and runs them in an interpreter.
Applet ها برنامه هایی هستند که به زبان جاوا نوشته می شوند و دارای خصوصیات زیر می باشند:
As a development environment, Java technology provides you with a large suite of tools:
1-Compiler
2-Interpreter
3-Document generator
4-Class file packaging tool
در این sample نشان داده شده است که چگونه می توان کلاس Exception مورد نظر خود را نوشت و آن را Throw کرد:
public class MyException extends Exception
{
public String toString(String str1)
{
return str1;
}
}
public class Test
{
public static void meth1(int a, int b) throws MyException
{
if (a<b) throw new MyException();
}
public static void main(String arg[])
{
try
{
Test.meth1(1,2);
}catch(MyException e)
{
System.out.println(e.toString("It is my Exception Test"));
e.printStackTrace();
}
}
}
1. Java removed pointers and it is a reason for security in java.
2. For transferring HTML files, the HTTP protocol was discovered.
3. Java has compiler and interpreter.
4. Java compiler creates byte code file.
5. Byte code is a language for JVM.
6. Byte code will be interpreted to the appropriate language of processor by interpreter.
7. Applets do not have main method, they have init(), start() and paint() methods.