https://github.com/agrimsachdeva/CS602Java
Java vocab flash cards:
https://quizlet.com/135054776/java-vocab-flash-cards/
Hard Midterm Questions:
1. The AWT makes use of the view-model-controller architecture. F
2. Each nested container has its own layout manager. F
3. 1. Events are _____user actions________ generated by event sources, which are then received by event ___listener_______________.
4. The addActionListener() method is used to _____ping______________ a listener.
5. A data variable plus a mutator method and an accessor method is called ____property___________________.
6. The ItemListener interface requires implementation of the __item state changed__________method which takes ___item event________________as an argument.
7. An adapter class defines ____dummy______________ versions of the methods required by an interface.
8. The command line argument to applet viewer must be a class file. F
9. The return from a call to readObject() is an object of type Object. T
10. The Applet class implements the AppletStub and AppletContext interfaces. T
11. The first character of an identifier may be a number. F
12. A
Doubts:
1. The basic Java graphic drawing primitive is the drawPoint() method. - F - Is it paint()? Drawline
2. 1. True or False: An event adapter translates byte data into unicode. - F? Low level events into high level
3. The argument to the addActionListener() method must be the object which implements the _ActionListener_________________ interface and has defined the ____________________ method.
4. An interface may not have multiple parents. - F?
5. The first command line argument stored in String[] args is always the program name. - F?
6. An interface can extend an existing interface through inheritance. - T?
7. An anonymous inner class is typically constructed as an argument to a method. - T
8. Access is specified at the object level rather than at the class level. - F?
9. 1. An inner class may extend a class other than the one its container extends. T
1. Java
allows the use of “named” pointers.
Java vocab flash cards:
https://quizlet.com/135054776/java-vocab-flash-cards/
Hard Midterm Questions:
1. The AWT makes use of the view-model-controller architecture. F
2. Each nested container has its own layout manager. F
3. 1. Events are _____user actions________ generated by event sources, which are then received by event ___listener_______________.
4. The addActionListener() method is used to _____ping______________ a listener.
5. A data variable plus a mutator method and an accessor method is called ____property___________________.
6. The ItemListener interface requires implementation of the __item state changed__________method which takes ___item event________________as an argument.
7. An adapter class defines ____dummy______________ versions of the methods required by an interface.
8. The command line argument to applet viewer must be a class file. F
9. The return from a call to readObject() is an object of type Object. T
10. The Applet class implements the AppletStub and AppletContext interfaces. T
12. A
final class is simply a class that can't be extended.
13. An object may access the pivate member of another class in the same package. F
14. Constructor may be declared abstract. F
15. Command line argument is stored in String[] args. T
16. Constructor may be declared static. F
17. itemStateChanged is the notification method of an Item Listener. T
18. An import statement inserts library code prior to compilation. F
19. Applet security restrictions: http://docstore.mik.ua/orelly/java/javanut/ch06_08.htm
20. throw keyword is used to throw Exception from any method or static block in Java while throws keyword, used in method declaration, denoted which Exception can possible be thrown by this method. They are not interchangeable.
21. A checked exception is one that extends Exception but not RuntimeException. T
22. Constructors are inherited. F
23. Equality: https://www.sitepoint.com/implement-javas-equals-method-correctly/
24.
Doubts:
1. The basic Java graphic drawing primitive is the drawPoint() method. - F - Is it paint()? Drawline
2. 1. True or False: An event adapter translates byte data into unicode. - F? Low level events into high level
3. The argument to the addActionListener() method must be the object which implements the _ActionListener_________________ interface and has defined the ____________________ method.
4. An interface may not have multiple parents. - F?
5. The first command line argument stored in String[] args is always the program name. - F?
6. An interface can extend an existing interface through inheritance. - T?
7. An anonymous inner class is typically constructed as an argument to a method. - T
8. Access is specified at the object level rather than at the class level. - F?
9. 1. An inner class may extend a class other than the one its container extends. T
2. True
or False: The short circuit operators apply to boolean operands rather than
bits. T
3. True
or False: A top level class may be declared as “private”. Public or package only
4. True
or False: Calling the System.gc() method guarantees that the garbage collector
will be run. F
26. Given the following code:
public class StringConcatTest{
public
static void main(String[] args){
String
alpha = "alpha ";
String
beta = "beta ";
alpha
+= beta + "gamma";
System.out.println(alpha);
}
}
What is output to the screen?
- alpha
beta
- alpha
beta gamma
- beta
gamma
- beta
gamma alpha
29. What happens when you try to compile and run the
following code?
public class EqualityTest2{
public
static void main(String[] args){
Long
a = new Long(38);
Integer
b = new Integer(38);
if(a.equals(b))
System.out.println("Equal");
else
System.out.println("Not
Equal");
}
}
- The
program will not compile.
- The
program compiles but throws a runtime exception.
- The
program compiles, runs and prints “Equal”.
- The program compiles, runs and prints “Not Equal”.
Comments
Post a Comment