Micro Station Technology, Inc.

Java Language


What's wrong with this Java code snippet?

public class pen {
   private int redValue, greenValue, blueValue;
   ...
   public void getRGBColor(int red, int green, int blue) {
      red = redValue;
      green = greenValue;
      blue = blueValue;
   }
   ...
}

Given the class definition as such,
  public class IdentifyParts {
     public static int x = 7;
     public int y = 3;
  }

What is the output from the following code:

  IdentifyParts a = new IdentifyParts();
  IdentifyParts b = new IdentifyParts();
  a.y = 5;
  b.y = 6;
  a.x = 1;
  b.x = 2;
  System.out.println("a.y = " + a.y);
  System.out.println("b.y = " + b.y);
  System.out.println("a.x = " + a.x);
  System.out.println("b.y = " + b.y);


What sort of member visibility (or access control) the Java language has?
Explain the difference in the context of package.

What is 'reflection' in the Java language?
What main functionality does this provide to the Java programs?

Write a short program to create a simple Button object and
display this object's superclasses.

What is "interface" in the Java language?
How does it relate two classes?  How can we use it as programming
interface?  And how does it model model multiple inheritance?

Java has these three keywords: try, catch, and finally.
Explain with a simple example how these can be used in the Java
programs.  Illustrate the syntax and semantics of these constructs.

Java has these two keywords: throw and throws.
Are they used in the sense of first person and third person, respectively?
How are they used?

Java has 'switch' statement?  Can it switch on enumerated type?
Provide an example.


Java String class is immutable.  What does this mean?
If you really need to manipulate strings, what class should you use?

In the following Java code snippet, what sort of syntax is this
List?  What does it represent?

public class Stack {
   private List items;

   public Stack() {
       items = new ArrayList ();
   }

   ...
}



What are the differences between these two declarations in terms of functional argument?
	static public void main (String[] args) { }
	static public void main (String args[]) { }

What branching statements do you know?  Explain them and their variations in the
context of labels.

Why javax not java?
	import javax.swing.*;