Final Flashcards
(231 cards)
What buzzwords can be used to describe the Java language?
simple, objected-oriented, portable, secure
What is the Java platform?
the hardware or software environment in which a program runs
How does the Java API support many kinds of programs?
The API offers many ready-to-use classes that are popular in many programs ie. Math class
What are the advantages of Java?
easy to learn, write once and run everywhere
What is the skeleton for any Java program?
comments, class definition, the main method
What is the entry point for any Java application?
the main method invokes all the other methods
What is the function of the import statement?
allows you to use public packages inside of your package, tells the compiler where to find the package
What are the five characteristics of an object-oriented approach to programming?
- everything is an object
- a program is a bunch of objects that communicate by sending messages
- each object has its own memory
- every object has a type
- objects of a particular type can receive the same messages
What are two reasons for controlling access to members of objects and how does Java implement control?
- keeps client programmer hands off portions they shouldn’t touch
- allows you to change the internal workings of a program with out it affecting the client programmer
Control is implemented through access specifiers
What are two ways of re-using classes?
composition and inheritance
How does late binding enable upcasting and polymorphism?
late binding enables upcasting and polymorphism because the method to call is determined at runtime instead of compile time
What is a container? What is an advantage of using a container?
container- an object that holds references to other objects (ie. ArrayList)
has the advantage of expanding whenever necessary to to hold what you want to put inside
What is ‘parameterized types/generics’? Explain how it eliminates the need for downcasting.
parameterized types are a class that can be used to customize a container to only work with a particular object type (ie. ArrayList will only accept String objects)
eliminates downcasting because the specific type is known when created
Where in memory does Java create objects?
the heap
What is function of exception handling and how does Java reinforce consistent use of handling exceptions?
exception handling is done so when a problem arises in your code instead of terminating the program an exception can be handled so something else will occur instead
exceptions are hard wired into Java so that you must handle exceptions properly or a compile-time error will be given
What are the functions of threads in single-processor and multi-processor environments?
in a single-processor, threads can allocate the time in a program
in a multi-processor threads can be assigned a different processor and run in parallel
What is the primary idea of a client/server system?
you have a central repository of information that you want to distribute to a set of people or machines
How did Web serving lead to client-side programming?
with web serving to accomplish a task everything had to be first sent to the server which can be slow
client-side programming allows programs to run under the browser without needed to send everything first to the server
What is CGI programming and what is its major shortcoming?
a way for web servers to interface with programs installed on the server
can be complicated to maintain and can be slow
Why is client-side programming efficient for the Web?
it allows the browser to do a lot of the work making it faster and more interactive for the user
What is a plugin?
a piece of software (code) that is downloaded to a browser to add functionality
What is a scripting language?
a language where the source code is embedded directly into the HTML page
Compare scripting languages to Java for Web page needs.
Java- good for large-scale projects with large volume of traffic, can solve more complicated problems
scripting language- easy to understand, can run without a web browser
What are the issues of Intranet versus Internet programming?
on the internet you must worry about spreading buggy code and making the code work across different platforms.
on the intranet the above is not so worrisome so you want to find the quickest solution to a problem that uses existing code when possible