










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











What is an “Advanced”
Programming Language?
int main() { char name[1024]; printf(“Enter your name: ”); gets(name); printf(“Your name is: %s\n”, name); return 0; }
Java: A Type-safe, Imperative
Language
import java.io.; import java.util.;**
class Summation { public static void main(String[] args) { List list = new LinkedList();
for (int i=0; i<args.length; ++i) list.add(args[i]);
int sum = 0; while (!list.isEmpty()) sum += ((Integer)list.remove(1)).intValue();
System.out.println(sum); } }
Java: A Type-safe, Imperative
Language
import java.io.; import java.util.;**
class Summation { public static void main(String[] args) { List list = new LinkedList();
for (int i=0; i<args.length; ++i) list.add(args[i]);
int sum = 0; while (!list.isEmpty()) sum += ((Integer)list.remove(1)).intValue();
System.out.println(sum); } }
Cast Exception!
OutOfBounds Exception!
programmed in imperative languages!