Professional Documents
Culture Documents
7 Ms - Excel:Formulas and Functions 2010: 8.introduction To Programming in JAVA
7 Ms - Excel:Formulas and Functions 2010: 8.introduction To Programming in JAVA
Select the cell where the answer will appear (F15, for example). Type the equals sign (=),
then enter the function name (SUM, for example). Enter the cells for the argument inside
the parentheses. Press Enter and the result will appear.
1 Portability: Portability means that the same bytecode program can run on any computer
system that has a Java interpreter. Also a source program can be compiled into
bytecodes on any computer that has a Java compiler.
2 Applet: An Applet is a Java bytecode program that runs on a Web browser. Most up-to-
date web browsers include a Java interpreter. A web page may contain an applet, which
means that part of what the page displays is controlled by Java bytecodes.
Applets are used for user interaction, graphics, and animation.
C. Answer the following questions.
1 First question is for Homework.
2 Describe what happens if, in Helloworld.java, you omit.
1) main: Error: <identifier> expected
public static void(String args[])
2)String: Error: <identifier> expected
public static void main(args[])
3)System.out: Error: cannot find symbol println
symbol: method println(String)
location: class Area_r
4)println: Error: cannot find symbol System.out
symbol: method out(String)
location: class System
5)HelloWorld: Error: <identifier> expected class
3 Describe what happens if, in Helloworld.java, you omit.
1)the; : Error: ;Expected
2)the first “: Error: not a statement ‘;’ expected
3)the second “: Error: Unclosed string literal
4)the first {: Error: ‘{‘ expected class Helloworld.java
5)the second {: Error: class, interface/enum expected.
6)the first }: Error: reached end of file while parsing }
4 Describe what happens if, in Helloworld.java, you misspell(by,say,omitting the
second letter)
1)main: error: can't find main(String[]) method in class: Helloworld
2)String: error: cannot find symbol
public static void main(Sring args[])
^
symbol: class Sring
location: class Helloworld
3)Helloworld: No Error,displays output
4)System.out: error:package Sstem does not exist Sstem.out.println
5)println: error: cannot find symbol System.out.pintln
symbol: method pintln(String)
location: variable out of type PrintStream