Difference between canvas class & graphics class?



Difference between canvas class & graphics class?..

Answer / mallareddy.pindi

The Canvas class is a base class for writing applications
that need to handle low-level events and to issue graphics
calls for drawing to the display. Game applications will
likely make heavy use of the Canvas class. From an
application development perspective, the Canvas class is
interchangeable with standard Screen classes, so an
application may mix and match Canvas with high-level screens
as needed. For example, a List screen may be used to select
the track for a racing game, and a Canvas subclass would
implement the actual game.
The Graphics class provides the framework for all graphics
operations within the AWT. It plays two different, but
related, roles. First, it is the graphics context. The
graphics context is information that will affect drawing
operations. This includes the background and foreground
colors, the font, and the location and dimensions of the
clipping rectangle

Is This Answer Correct ?    13 Yes 1 No

Post New Answer

More Core Java Interview Questions

Is java written in c?

0 Answers  


What is private public protected in java?

0 Answers  


how and when compiler knows that the Java code throws the checked Exception.

2 Answers   HSBC,


Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public private.

2 Answers  


How many digits is int32?

0 Answers  






Write a program in java to find the maximum and minimum value node from a circular linked list.

0 Answers  


What are the files generated after using IDL to java compiler?

0 Answers  


can we write two same methods in outer class and innerclass.

1 Answers   3i Infotech,


In java, what is the difference between method overloading and method overriding?

0 Answers  


What are the data types supported by java? What is autoboxing and unboxing?

0 Answers  


What is a protected class in java?

0 Answers  


How do you declare a variable?

0 Answers  


Categories