Introduction to Java : Distributing Applets part-1

Fadıl

Introduction

Once you have finalized your applet code, the final stage in the development process will be to determine how to make your program available to browsers on the web.

In the last section, we showed an example of this when we created a class file, referenced it with our HTML, and sat back while web surfers played with our applet.

This approach is realistic for “example” applets and silly little ticker tape programs typical of some Java development, but it may be unrealistic for real-world applications.

PHP Function: Built-in Functions part 2

Fadıl

Welcome back to part 2 of Built-In functions, just a reminder.

count()
The count() function counts the number of elements in a variable. It’s usually used to count the number of elements in an array, because any variable that is not an array has only one element – itself.

In the following example, $a  is assigned a value equal to the number of elements in the $colors array:

$a = count($colors);
if $colors contains the values "blue", "black", "red", and "green",
 $a will be assigned a value of 4.

each() and list()
The each() and list() functions usually appear together, in the context of stepping through an array and returning its keys and values. Here is the syntax for these functions.

Introduction to Java : Building Your First Application part-3

Fadıl

Applet Tag by Example

Here is an example of the code we could use to place the Hello applet we created previously in a web page:

<APPLET WIDTH = "200" HEIGHT = "100"
           CODE = "Hello.class">
</APPLET>

Notice that we gave the applet a specific width and height. For an applet to appear, you must give it a specific width and height. If you don’t want an applet to display (such as when your applet creates a popup frame right away), you can give it a width and height of 0:

Introduction to Java : Building Your First Application part-2

Fadıl

Writing Applets

Applets are programs that run inside of a web page using the resources the web browser has to offer such as a Java Virtual Machine (JVM) and the default set of class libraries.

When you initially hit a web page with an incorporated Java applet, you usually see a gray box where the applet will show up and then slowly, the applet loads and appears in the space of the gray box.

PHP Function: Built-in Functions part 1

Fadıl

Array Fuctions –

array()
The array() function allows you to manually assign values to an array. Here is the syntax of the array() function:
$array_name = array(“val1”, “val2”, “val3”, …);

array_push()
The array_push() function allows you to add one or more elements to the end of an existing array. Its syntax is
array_push($array_name, “element 1”, “element 2”, …);

array_pop()
The array_pop() function allows you to take (pop) off the last element of existing array. Its syntax is
array_pop($array_name);