Question
How would you go about opening an image file called MyPicture.jpg
1) Graphics.getGraphics("MyPicture.jpg");
2) Image image=Toolkit.getDefaultToolkit().getImage("MyPicture.jpg");
3) Graphics.openImage("MyPicture");
4) Image m=new Image("MyPicture");

Answers

Opening an image file requires an Image object, The Image class has no constructor that takes the name of an image file . For an application (rather than an applet) an image is created using the Toolkit class as in option 2.
2) Image image=Toolkit.getDefaultToolkit().getImage("MyPicture.jpg");   Your Comment




More Software,Go,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q An IS auditor needs to link his/her microcomputer to a mainframe system that uses binary synchronous data communications with block data transmission. However, the IS auditor's microcomputer, as presently configured, is capable of only asynchronous ASCII character data communications. Which of the following must be added to the IS auditor's computer to enable it to communicate with the mainframe system? A. Buffer capacity and parallel port B. Network controller and buffer capacity C. Parallel port and protocol conversion D. Protocol conversion and buffer capability
  • Q Who directed the film Pather Panchali"?
  • Q What is plasma cell
  • Q How do you usually solve problems?
  • Q Must I free allocated memory before the program exits?
  • Q Would you leave us if another company offers you 2K more than us
  • Q What are the basic resources required to configure oracle goldengate high availability solution with oracle clusterware?
  • Q Difference between Function and Stored Procedure?
  • Q What are the exceptions in pl/1
  • Q Which national honour was conferred on Bollywood actors Dileep Kumar and Amitabh Bachan in 2015?
  • Q What are LRO's( Linked Reporting Objects)?