COMP 274 Week 1 Homework
1. What is the Java source filename extension?
2. Write a Java statement to display the string “The value is 100” to a user in a plain dialog box.
3. What is the command you would use to compile the file Addition...
COMP 274 Week 1 ilab Programming Assignment
Do the following two programs:
Write a Java application that inputsthree integers from the user and displays the sum, average, product, smallest and largest of the numbers. Use a Scanner object to get...
COMP 274 Week 2 Homework
1. Can you access an instance variable from a static method? Explain why or why not.
2. Can you access a static variable from an instance method? Explain why or why not
3. Consider the case where you have two classes, ClassA...
COMP 274 Week 2 iLab
COMP 274 Week 3 Homework
1. Write a statement to create a JFrame object with a title of “My GUI Application”.
2. Given the object you created in question 1,write a statement to specify the window size to be 300 pixels wide and 400 pixels...
COMP 274 Week 3 iLab
COMP 274 Week 4 Homework
1. What is an abstract class and how does it differ from a regular class?
2. Why are abstract class constructors defined as protected?
3. Class X defines method M1( ) as abstract. Class Y inherits from Class X and...
COMP 274 Week 4 Lab
COMP 274 Week 5 Homework
1. Describe the graphical coordinate system in Java. Where is the origin? What units apply to the x,y coordinates?
2. How would you use the Graphics class to draw a line between 2 specific points? Give an example.
3. How do...
COMP 274 Week 5 iLab
COMP 274 Week 6 Homework
1. What is the difference between throwing an exception and catching an exception?
2. How does a method declare that it can throw an exception? How does it actually throw an exception? Use Java code to illustrate your answer...
COMP 274 Week 6 iLab
COMP 274 Week 7 iLab