Tuesday, April 15, 2008

remote microscopy

A modular microscope attachment for cell phones could improve the quality of telemedi



Mobile microscopy: A cell phone incorporating a microscope (top) developed at the University of California, Berkeley, can capture and transmit pictures such as this 23x-magnification image of the freshwater crustacean Cyclops (bottom). Researchers hope that the device will allow patients in remote areas to send images of red blood cells and other diagnostic information to medical specialists.Credit: David Breslauer
Researchers at the University of California, Berkeley, have developed a modular, high-magnification microscope attachment for cell phones. The device will enable health workers in remote, rural areas to take high-resolution images of a patient's blood cells using a cell-phone camera, and then transmit the photos to experts at medical centers.
The researchers hope that the innovation will help patients with blood disorders who live far from medical specialists get more accurately diagnosed and treated. "I wanted to make optical design relevant to today," says Daniel Fletcher, a professor of bioengineering at Berkeley. Fletcher's students found it relatively easy to integrate a simple arrangement of lenses with the cell-phone camera and transmit magnified images to a laptop using a Bluetooth attachment to the phone. The work prompted Fletcher to file a patent through the university and try to make a practical microscope. The researchers say that the cameras in late-model phones are capable of capturing all the details that a doctor would need to identify malaria parasites and cancer cells.
"The challenge was to make a low-cost, durable device with a long battery life," says David Breslauer, a graduate student in Fletcher's lab. "As engineers, we initially wanted to make a whiz-bang gadget to take pictures of both skin and blood. But people in the field told us, 'Once it gets too complicated, no one is going to want to use it. Make something simple that just does the task.'"
The total cost of the first prototype, built from off-the-shelf components, was $75. The current version provides its own sample illumination from cheap, low-power LEDs. The device comes in two versions: with a magnification of about 5 times, for taking images of moles and rashes, and with a magnification of about 60 times, for capturing the details of blood cells and parasites. The higher-magnification model--the larger of the two--is roughly the size and shape of a roll of quarters. Both scopes attach to the phone with a modified belt clip.
"Microscopy is still considered the gold standard" for malaria diagnosis, says Katherine Herz, a medical doctor and a fellow in health policy at Stanford University. "If microscopy could be done with portable equipment ... [it] might be adopted far more widely and prove extremely useful."
Fletcher plans to test the microscope cell phone in Uganda this summer. Initially, his lab will make prototypes, but eventually, it plans to hand off the design to a manufacturer. The Blum Center for Developing Economies at Berkeley, which provided initial funding, will help test the device in Kampala. The scheme is to train local personnel and provide them with the necessary equipment to take pictures of patients' blood on special slides, and then phone in the images to specialists who can identify and count malaria parasites.
The researchers also hope to collaborate with a telemedicine program at the University of California, Davis, that serves rural California. Leukemia patients in remote areas could use the microscope cell phone to transmit images for white blood cell counts

Unique Locks On Microchips Could Reduce Hardware Piracy

Hardware piracy, or making knock-off microchips based on stolen blueprints, is a burgeoning problem in the electronics industry.
Computer engineers at the University of Michigan and Rice University have devised a comprehensive way to head off this costly infringement: Each chip would have its own unique lock and key. The patent holder would hold the keys. The chip would securely communicate with the patent-holder to unlock itself, and it could operate only after being unlocked.
The technique is called EPIC, short for Ending Piracy of Integrated Circuits. It relies on established cryptography methods and introduces subtle changes into the chip design process. But it does not affect the chips' performance or power consumption.
Michigan computer engineering doctoral student Jarrod Roy will present a paper on EPIC at the Design Automation and Test in Europe conference in Germany on March 13.
Integrated circuit piracy has risen in recent years as U.S. companies started outsourcing production of newer chips with ultra-fine features. Transferring chip blueprints to overseas locations opened new doors for bootleggers who have used the chips to make counterfeit MP3 players, cell phones and computers, among other devices.
This is a very new problem, said Igor Markov, associate professor in the Department of Electrical Engineering and Computer Science at U-M and a co-author of the paper.
"Pirated chips are sometimes being sold for pennies, but they are exactly the same as normal chips," Markov said. "They were designed in the United States and usually manufactured overseas, where intellectual property law is more lax. Someone copies the blueprints or manufactures the chips without authorization."
A cutting-edge fabrication facility costs between $3 billion and $4 billion to build in the United States., said Farinaz Koushanfar, assistant professor in the Department of Electrical and Computer Engineering at Rice University and a co-author on the paper.
"Therefore, a growing number of semiconductor companies, including Texas Instruments and Freescale (a former division of Motorola), has recently announced that they would cease manufacturing chips with finer features, and outsource production to East Asia. However, even in U.S. facilities, working chips are sometimes reported defective by individual employees and later sold in gray markets," Koushanfar said.
With EPIC protection enabled, each integrated circuit would be manufactured with a few extra switches that behave like a combination lock. Each would also have the ability to produce its own at least 64-bit random identification number that could not be changed. The chips would not be manufactured with an ID number, but instead with the tools needed to produce the number during activation.
In the EPIC framework, chips wouldn't work correctly until they were activated. To activate a chip, the manufacturer would plug it in and let it contact the patent owner over an ordinary phone line or Internet connection.
"All chips are produced from the same blueprint, but differentiate themselves when they are turned on for the first time and generate their ID," Roy said. "Nothing is known about this number before activation."
The chip would transmit its ID securely to the patent owner. The patent owner would record the number, figure out the combination to unlock that particular chip, and respond securely with the key.
The uniqueness of the activation key rules out the possibility that someone could observe it and reuse it without cracking it. Because the key is generated on the fly, it wouldn't make sense to copy it like you could copy software activation keys, which are printed on CD envelopes.
Theoretically, there are ways to illegally copy chips protected by EPIC, Markov said. But EPIC makes this very difficult.
"If someone was really bent on forging and had a hundred million dollars to spend, they could reverse-engineer the entire chip by taking it apart. But the point of piracy is to avoid such costs," he said. "The goal of a practical system like ours is not to make something impossible, but to ensure that buying a license and producing the chip legally is cheaper than forgery."
Posted by Be 1nnovat1ve at 11:20 AM

Turn Down the Heat … Please

Tom Reeves, VP of semiconductor and technology services at IBM, sat down with Electronic News at the site of the company’s 200mm fab and mask operation near Essex Junction, Vt., for a candid conversation about what’s next in chip manufacturing, where the problems are and where future technology will come from. What follows are excerpts of that conversation.
Electronic News: What’s the next big break in chip technology?Reeves: Through the ’70s and early ’80s, bipolars went up to 100 watts. We had water-cooling systems, but you needed something new. Then we started with CMOS, which was a Holy Grail step-function improvement. Now, 20 years later, we’ve got 100 to 120 watt chips again. Power is everything. The efforts we’re taking to get leakage power down for cell phones or a base station or a Cisco switch are enormous. If you look at a chip in a base station or a switch, they’re 40 watts, and there are a lot of them. The total wattage gets up to 5,000 or 10,000. So the major focus now is not on Moore’s Law and how you get the next density step. We’ll get that. How you get the next performance step is harder work than it’s been, too. But the most important issue is how you manage power. Leakage power at the most advanced lithography is very challenging. And with active power, can you cool the gain? College kids were hanging some gaming systems out their dorm windows to cool them down.
Electronic News: So how do we solve these problems? Are we at a point where the road map is broken and we have to re-think what we’re doing?Reeves: I think we can make incremental improvements. At 65 nanometers, we have solved that. At 45, we have additional ideas. But as you look at 32 nanometers and beyond, it’s still an open question. At 65 and 45 we’re using header and footer switches to turn things on and off, dynamic voltage scaling, dynamic frequency scaling. We’re qualifying processes for lower voltage levels than we would have. We’ve used voltage islands, too.
Electronic News: But isn’t that a Band-Aid approach?Reeves: I’d call it business as usual—brute, tough-it-out engineering. It’s not like bipolar going to CMOS, though. We don’t have a panacea on our road map. There are certainly some interesting technologies—carbon nanotubes are one of them—but they all look as if they’re 20 years out, not five years out. There are some ultimate solutions that are game-changers. But at 32 nanometers and the step after that, we have CMOS and SOI.
Electronic News: What’s the big bottleneck now?Reeves: Leakage power is now equal to active power. Leakage power used to be insignificant. The Swiss and Japanese watchmakers were the only ones worried about leakage because it affected how long the battery lasted. Sharp created a new cell phone, which is only available in Japan, with an Aquos LCD screen for watching TV. It’s the same material as in their TV screens. It tunes analog signals, digital signals and FM signals through an IBM silicon-germanium tuner, and it has an IBM EDRAM ASIC. They came to us and said they wanted 600,000 of each as fast as we could make them. It launched in early June in Japan. TV-tuning standards are different by country. A different model has to come out for Korea and Europe, and a different one—probably years from now—in the United States, because we tend to lag these standard migrations.
Electronic News: Does it matter to IBM which form factors sell best and which standards are used?Reeves: We buffer the risk for customers. For example, we’re not sure whether ultra-wideband, WiMax or Zigbee will win, but we have collaborative design partners on all of them. Whatever wins, we’re going to ride it.
Electronic News: Are there any trends about who’s going to be using these new technologies?Reeves: Well, the United States is embarrassingly delayed on cell phones technology. I was in Japan about a month ago and commenting about when a phone in the United States would be able to get these terrestrial TV broadcasts. Every one of our salespeople there opened up their cell phones. They all had TV tuners. The oldest phone was two years old. In Japan, they’ve had broadcast-reception phones for two years. Korea and Japan drive these new standards aggressively. Only GPS [global positions systems] in phones seems to be rolling out as fast here. This is a new market for IBM. We’ve only recently gotten into the consumer market, and it’s a very sophisticated market.
Electronic News: Will consumer drive the high-end of the chip market or will it still be computers and networking?Reeves: The consumer market is going to ship more 65 nanometer earlier than the data-processing or the networking market. The network market drives 18-by-18 die in every generation, which the consumer market never will. Data processing and networking will always lead in difficulty at the mask house, yield engineering and test strategy. But in terms of using new litho nodes, the digital camera guys are further along in their plans of ramping manufacturing than the Ciscos and Junipers.
Electronic News: Let’s swap directions here. A year ago you said that if IBM’s customers follow its design rules, yield will be in the 90 percent range. Is that still true?Reeves: We’ve maintained that 90 percent to 100 percent range consistently for digital ASICs. We provide the entire design environment, including a test-generation methodology. Cisco will do six ASICs for a line card, and all six will be single-pass silicon. What’s new is that we’ve extended that approach into the world of analog. In that case we won’t provide an entire ASIC design flow. We provide electrical models. But what we’re demonstrating is that we have a much tighter accuracy between the electrical models to the silicon we get back than other mixed-signal suppliers. Analog is something of a black art. But if you know what you want and how to design it, and assuming the electrical models are right, IBM can give you an environment where you have first-pass analog silicon. Other vendors are not that close in terms of electrical-to-hardware coordination. If it doesn’t work, you have to determine whether it was the design or the electrical models. It’s a very difficult process.
Electronic News: As a result of this, are you finding more buy-in from customers than in the past for your recommendations?Reeves: I think there’s a clear trend toward buy-in. More and more, people are looking for tools to help them analyze the complexity of their potential designs before they send it out, and if it yields can they drop their customer price? Those conversations didn’t occur five years ago.
Electronic News: Does that 90 percent number work for analog designs, too?Reeves: No, that’s strictly for digital ASICs, where you have an IBM-managed library, an IBM timing tool and router, IBM test methodology and power management. In analog and mixed signal, we’ve taken the uncertainty out of whether silicon will behave exactly the same way as the electrical models we gave you. But in that area, the client is still picking what tool they want to use. It may be Cadence for one thing and Synopsys for another. We haven’t made an investment in an RF CMOS or a mixed-signal design system.
Electronic News: Let’s look at design for manufacturability from a different standpoint. IBM has said it needs seven of the eight cores on the Cell processor to work for Sony’s Playstation. Will there be an aftermarket for chips with fewer operational cores?Reeves: There are a lot of chips with six cores operational, and we’ve been thinking about whether we should really throw all of those away. We also have a separate part number for chips with all eight cores good. The stuff that’s going to be for medical imaging, aerospace and defense and data uses eight cores.
Electronic News: But might it be the less-expensive version of Playstation 3?Reeves: It could, but I don’t think Sony has thought about offering that. That doesn’t mean there aren’t good uses for a chip with four SPEs [synergistic processing elements].
Electronic News: What’s the defining factor that makes some chips better than others?Reeves: Defects. It becomes a bigger problem the bigger the chip is. With chips that are one-by-one and silicon germanium, we can get yields of 95 percent. With a chip like the Cell processor, you’re lucky to get 10 or 20 percent. If you put logic redundancy on it, you can double that. It’s a great strategy, and I’m not sure anyone other than IBM is doing that with logic. Everybody does it with DRAM. There are always extra bits in there for memory. People have not yet moved to logic block redundancy, though.
Electronic News: Do any of those cores ever go bad, so that you start out with seven and you wind up with six or five?Reeves: There’s a reliability failure rate for all chip types. By definition, reliability failure is one point circuit that has failed. If it happens to be in an SPE, it will knock out one of the cores. We have electronic fuses now, rather than laser fuses, which you can only blow when you’re doing wafer tests. Electronic fuses you blow electrically. If you really want to be focused on reliability and up-time availability, you can design one of these chips to self-detect. You can ship it with eight cores working, blow one of them, and from a user perspective you would have self-healed it in the field.
Electronic News: But would it be as fast as the chip with eight cores?Reeves: Yes, because the Playstation 3 only uses seven of them. You’d have a spare. That isn’t implemented in Cell, but it could be. We implemented that same strategy for IBM systems. If you take a logic hit on a chip, you don’t have any impact on performance because there is enough redundancy built in.
Electronic News: What happens if one of the cores blows on the Sony Playstation 3 if there are only seven to start with?Reeves: It’s just like a reliability failure on your TV or DVD recorder. If it’s within warranty, you send it back. If it’s not, your game doesn’t work anymore. You’ll always have choices about how reliable you want to make a chip with burn-in. Most chips that go into the consumer marketplace on things such as camcorders or DVD players aren’t burned in. But you can add burn-in and improve reliability 5x to 10x. It’s extra cost. Certainly, a company like Sony adds that in.
Electronic News: How much extra cost?Reeves: It’s variable. On DRAMs and SRAMs, it’s cents. On processors, because they’re so high-powered, it’s not trivial to power 100 or 1,000 at a time. With all the wattage, it can be dollars.
Electronic News: With the price Sony is going to charge, it can easily add that into the cost.Reeves: Sony is very concerned about quality and backward compatibility. They want to get this right. They tested game after game after game. When there were about 40 Playstation 1 games that didn’t work properly, that didn’t pass their criteria for quality.
Electronic News: So does that mean the current Playstation 2 systems have a Cell processor?Reeves: No, they have a 440 Power processor. It’s a 130-nanometer, single-core ASIC chip. It’s the same technology as if you buy a Sony DVD or a Sony Bravia TV. Sony is replacing all the Mips design points with Power design points.

latest mobile phones

Nokia 5310 Xpress Music
Nokia 6500 Slide
Nokia 6500 classic
Nokia N81
Nokia 6120 classic
Nokia 2630
Nokia 8600 Luna
Nokia 6300
Nokia E65
Nokia 6085
Nokia N95
Nokia 5300 XpressMusic
Nokia 6288 (Black)
Nokia 6111 (Pink)
Nokia N73
Nokia 6111
Samsung - Clearance
Samsung G600
Samsung G800
Samsung F210
Samsung U600 Pink
Samsung D900i
Samsung E590
Samsung U600
Samsung D840
Samsung E250
Samsung D900
Samsung E900
Sony Ericsson - Clearance
Sony Ericsson W880i Silver
Sony Ericsson K850i
Sony Ericsson T650i Green
Sony Ericsson T650i Blue
Sony Ericsson W910i
Sony Ericsson W200i
Sony Ericsson W880i
Sony Ericsson W850i
Sony Ericsson W800i
Sony Ericsson K800i
Sony Ericsson W700i
Motorola - Clearance
Motorola RAZR2 V8
Motorola RIZR Z8
Motorola KRZR K1
LG - Clearance
Prada phone by LG
LG KE970 (Shine)
LG KG800 Chocolate (Pink)
LG KG800 Chocolate (White)
LG KG800 Chocolate

crystals

General Electronic Devices manufactures crystal blanks from raw material quartz bars to final-sealed and fully tested components for use in our oscillators and discrete crystal elements.We maintain an inventory of cultured quartz the quality of which, in many cases, approaches the best the industry can produce. We control all manufacturing process and assure that purchased material supporting those processes produced a finished product with extra quality and performance at no additional cost.Special attention is given to the beginning stages of production. Tight control of the angle of cut, high grade lapping compounds, consistent monitoring of flatness of both lapping plates and crystal blanks and precise chemical etching at times exceeding two times the minimum military requirements all assure a locked-in, high quality performance crystal. These controls give that extra kick through further processing and final environmental testing.All electrodes making electrical contact with the major surfaces of the crystal are deposited by vacuum deposition in ultra pure, high vacuum coating machines using special fixtures. This allows high volume with absolute registration of electrodes between one side of the crystal and the other.Photo-etched masking and pure base coating materials such as Aluminum, Chrome, Gold and Silver – plus high vacuum equipment using evaporation and E-beam produce electrically conductive contact points to the crystal surface. These gives near zero resistance and high energy trapping of the crystal’s electric field with minimum long-term aging. Final frequency adjustment of the crystal is done exclusively in custom-made, high vacuum evaporation equipment and our new state-of-the-art automated equipment.Little final adjustment is required or desirable because additional amounts of metal used in excess in this process will degrade the overall performance of the crystal and aggravate spurious responses.We have total sealing capability at GED and can package our crystals and oscillators in any of three different styles
including cold weld, resistance projection welding and seam welding. We can seal as many as 4,000 units a day from the DIP oscillator, standard HC-49
holder, special HC49/US holder, all military crystal packages including TO-5 and TO-8 and surface mount packages – all welded in pure, dry
nitrogen atmosphere.
-->We have total sealing capability at GED and can package our crystals in any of three different styles including cold weld and resistance projection welding. We can seal as many as 4,000 units a day from the DIP oscillator, HC-45, standard HC-49 holder, special HC49/US holder, all military crystal packages including TO-5 and TO-8 and surface mount packages – all welded in pure, dry nitrogen atmosphere.Our quartz crystals and oscillators are all 100% tested for any leaking.We make extensive use of various types of electronic test equipment for in-process and final testing. Military, High-Rel and commercial type crystals are tested on military CI meters, as well as on computerized environmental test system that can be programmed to measure and record frequency, activity and spurious responses from as low as minus 55°C to as high as 125°C.All GED's product are marked permanently by laser or by engraving. All our crystals and oscillators are backed by a 100% guarantee to meet or exceed – the specifications of our customers.

Receiver chip handles DisplayPort interface for desktops, laptops

Low-pin-count low-cost interface supports WQXGA resolution

The PanelPort VPP1600EMG DisplayPort receiver and timing controller IC provides the increased bandwidth needed for high-resolution digital media on desktop PC monitors, notebook displays, and LCD TVs. The DisplayPort interface uses spread-spectrum clocking and offers OEMs an increased level of signal integrity by significantly reducing EMI.

The DisplayPort interface uses one, two, or four data pair lanes with an embedded clock and yields 1.6- or 2.7-Gbit/s bandwidth/lane, with roughly 40% lower pin count than current interfaces. The 100-pin TQFP-packaged VPP1600EMG provides a customized SerDes using advanced serial interface and timing technologies.

The device is fully compliant to the DisplayPort 1.1a standard, supports a full video interface, and includes security encryption through HDCP1.3. The chip can support up to WQXGA (2,560 x 1,600 at 60 Hz) resolution in four-lane receiver display mode, as well as two-lane 1,920 x 1,080 at 60 Hz for notebook panels, and will drive cabling of up to 15 m long. ($5 ea/10,000available now.)

Splice connector’s unisex design eases electronic assembly

Applications such as stereo equipment, appliances, medical equipment, and automotive electronics require their wire connections to be not only sturdy enough to withstand such harsh environments, but flexible enough to facilitate assembly and repair processes. The Flat-Snap splice connectors accomplish this with a unique design that appears simplistic, but actually went through about 10 design changes before the final prototype was ready.

Sporting a unisex design, the Flat-Snap connectors basically mate with themselves by overlaying the two parts and pulling them away from each other until they snap into place. Reversing the motion disconnects the two. The connectors rapidly mate and unmate without force or performance degradation, without requiring cutting or recrimping wires.

JAVA ONLINE 10

1 . T h e f o l low i n g m e t h o d i n t h e T h r e a d c l a s s i s n o t d e p r e c a t e d :
( a) r e s u m e ( ) ; ( b ) s t o p () ; ( c ) s u s p e n d ( ); ( d ) y i e l d ( )

2 . S u p p o s e t h e r e ar e t h r e e Ru n n a b l e t a s k s , t as k 1 , t as k 2 , t as k 3 . H ow do yo u r u n t h e m i n a t h r e ad p o ol w i t h 2 fi xe d t h r e ad s ?
( a) E x e c u t o rS e rv i c e e xe c u to r = E x e c u t o rs . n e w F i x e d T h r e a d Po ol ( 2) ; e x e c u to r . e x e c u t e ( t as k 1 ) ; e xe c u - t or . e x e c u t e ( t a s k 2) ; e xe c u to r . e x e c u t e ( t as k3 ) ; ( b ) n e w T h r e ad ( t a s k 1) . s t a rt ( ) ; n e w T h r e a d (t a s k 2) . s t a rt ( ) ; n e w T h r e a d (t a s k 3) . s t a r t( ) ; ( c ) E x e c u t o rS e rv i c e e xe c u to r = E x e c u t o r s . n e w F i x e d T h r e a d Po ol ( 1) ; e x e c u to r . e x e c u t e ( t as k 1 ) ; e xe c u - t or . e x e c u t e ( t a s k 2) ; e xe c u to r . e x e c u t e ( t as k3 ) ; ( d ) E x e c u t o rS e rv i c e e xe c u to r = E x e c u t o r s . n e w F i x e d T h r e a d Po ol ( 3) ; e x e c u to r . e x e c u t e ( t as k 1 ) ; e xe c u - t or . e x e c u t e ( t a s k 2) ; e xe c u to r . e x e c u t e ( t as k3 ) ;

3 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) a b l o ck in g q u e u e h a s a c a p ac i ty.
( b ) T h e B l o ck i n gQ u e u e i nt e r f a c e i s t h e d e r i ve d i nt e r f a c e f o r al l c on c re te b l o cki n g q u e u e c l a s s e s . ( c ) A b l o ck i n g q u e u e c au s e s a t h r e ad t o b l o ck w h e n you t ry to a d d a n e l e m e nt t o a f u l l q u e u e . ( d ) A b l o ck i n g q u e u e c au s e s a t h r e a d t o b l o ck w h e n you t ry to r e m ove an e l e m e nt f r o m a n e m p ty q u e u e .

4 . A n i n s t an c e o f d e s c ri b e s p r o gr a m m i n g e r r or s , s u ch as b ad c a s t i n g, a c c e s s i n g an ou t - of - b o un d s a r ray, an d nu m e r i c e r r o rs .
( a) R u nt i m e E x c e p t i on ( b ) T h r owa b l e ( c ) E r r or ( d ) E x c e p t i o n

5 . A m e th o d mu s t d e c l a re t o t h row .
( a) ch e cke d e x c e p ti o n s ( b ) u n ch e cke d e x c e p ti o n s ( c ) E r r or ( d ) R u nt i m e E x c e p t i on

6 . W h i ch o f th e f o l l ow i n g i s n ot an a d va nt ag e o f J ava e x c e p ti o n h a n d l i n g?
( a) J ava s e p a r at e s e x c e p t i on h an d l i n g f r o m n o r m al p r o c e s s i n g t as k s .
( b ) E x c e p t i o n h a n d l i n g m ake s i t p os s i b l e f or t h e c a l l e r’ s c a l l e r t o h a n d l e t h e e xc e p t i on .
( c ) E x c e p t i o n h a n d l i n g i m p rove s p e r f o r m an c e .
( d ) E x c e p t i o n h an d l i n g s i m p l i fi e s p r og r am m i n g b e c a u s e t h e e r r or - re p or t i n g a n d e r r or - h a n d l i n g c o d e c an b e p l a c e d a t t h e c a t ch b l o ck .

7 . W h i ch o f th e f o l l ow i n g i s f a l s e ?
( a) E x c e p t i o n h a n d l i n g d e a l s w i t h u nu s u a l c i r c u m s ta n c e s d u r i n g p r og r am e x e c u t i o n . A s s e r t i on s a r e i nt e n d e d t o e n s u r e t h e c o r re c t n e s s of t h e p r og r am .
( b ) U s e as s e r t i on s t o re affi r m a s s u m p t i o n s .
( c ) u s e as s e r t i on s f o r ar g u m e nt ch e ck i n g i n p u b l i c m e t ho d s . ( d ) E x c e p t i o n h a n d l i n g ad d r e s s e s r o b u s t n e s s w h e r e a s a s s e r t i o n a d d re s s e s c o rr e c tn e s s .

8 . T h e m e t h o d i n t h e A c t i on E ve nt r e t u r n s t h e a c t i o n c o m m an d of t h e b u t t on . ( a) g e t I D ()
( b ) g e t M o d i fi e r s ( )
( c ) p a ra m S t ri n g ( )
( d ) g e t A c t i on C o m m an d ( )

9 . To ch e ck w h e t h e r a D E L E T E ke y i s p re s s e d or r e l e as e d , w h i ch h a n d l e r s h ou l d b e u s e d ?
( a) ke y I n ac ti ve ( K e y E ve nt e )
( b ) ke y Re l e as e d (K e y E ve nt e ) ( c ) ke y A c t i ve ( K e yE ve nt e ) ( d ) ke y Typ e d (K e y E ve nt e )

1 0. W h i ch o f th e f o l l ow i n g p r o p e r ti e s a r e i n G r i d Layo u t ?
( a) l ayo u t ( b ) h g ap ( c ) a l i gn m e nt ( d ) v i s i b l e

1 1. E ve r y l ayo u t m an a ge r i s a n i n s ta n c e of .
( a) t h e L ayo u tM an a ge r c l a s s ( b ) t h e L ayo u t i nte rf ac e
( c ) t h e L ayo u tM an a ge r i nte rf ac e ( d ) t h e L ayo u t c l a s s



1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e an E t ch e d B o r d e r?
( a) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( C ol o r . Y E L L OW , C ol o r . RE D )
( b ) n e w E t ch e d B o ar d e r ( )
( c ) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( ) ( d ) n e w E t ch e d B o r d e r (C ol o r . Y E L LOW , C o l o r. R E D )


1 3. Yo u c an n o t s e t a m n e m on i c p r op e r ty o n .
( a) a J m e nu B a r ( b ) a J M e nu I t e m ( c ) a J R ad i o B u t t on M e nu I te m
( d ) a J C h e ck B ox M e nu I t e m

1 4. a s k s a q u e s t i o n a n d r e q u i r e s t h e u s e r t o r e s p o n d w i th an ap p r o p ri a t e b u t t on .
( a) A m e s s a ge d i al o g ( b ) A n i n p u t d i al o g
( c ) A c on fi r m a ti o n d i a l og ( d ) A n o p t i on d i al o g

1 5. W h i ch o f th e f o l l ow i n g a r e s u b c l as s e s of j ava. aw t . C om p on e nt ?
( a) S w i n g u s e r i nt e r f a c e c l a s s e s
( b ) H e l p e r c l a s s e s s u ch a s C ol o r a n d Fo nt ( c ) A l l U t i l i ty c l a s s e s ( d ) L ayou t m an a ge r s

1 6. W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f or p l a c i n g t h e f ra m e ’ s u p p e r l e f t c o rn e r t o (2 0 0, 1 0 0) ?
( a) f r a m e . s e t L o c at i o n (1 0 0, 20 0) ( b ) f r a m e . s e t L o c at i o n (1 0 0, 10 0)
( c ) f r a m e . s e t L o c at i o n (2 0 0, 10 0) ( d ) f r a m e . s e t L o c at i o n (2 0 0, 20 0)


1 7. T h e m e t h o d s e t s t h e f o nt ( H e l ve ti c a, 20 - p o i nt b o l d ) i n c o m p o n e nt C .
( a) c . s e tFont ( n e w Font ( ”H e l ve t i c a ” , Fo nt. B OL D , 2 0 ))
( b ) c . s e tFont ( n e w Font ( ”h e l ve t i c a ”, B O L D, 20 ) ) ( c ) c . s e tFont ( Fo nt( ” H e l ve ti c a” , Font . B O L D, 20 ) ) ( d ) c . s e tFont ( n e w Font ( ”H e l ve t i c a ” , Fo nt. b ol d , 20 ) )

1 8. G i ve n a G r ap h i c s ob j e c t g, to d r aw a l i n e f r om t h e u p p e r l e f t c o rn e r t o th e b o tt o m r i g ht c or n e r , yo u u s e
( a) g . d raw L i n e ( 0, 0, ge t W i d t h ( ) , ge tW i d t h ( ) )
( b ) g . d raw L i n e ( 0, 0, ge t H e i g ht () , ge t H e i g ht( ) )
( c ) g . d raw L i n e ( 0, 0, 10 0, 10 0 )
( d ) g . d raw L i n e ( 0, 0, ge t W i d t h ( ) , ge tH e i ght ( ))

1 9. J C o mb oB ox fi r e s w h e n a n e w i t e m i s s e l e c t e d .
( a) j ava x. s w i n g. e ve nt . C h a n ge E ve nt ( b ) j ava x. s w i n g. e ve nt . A d j u s t m e nt E ve nt ( c ) j ava . aw t . A c t i on E ve nt ( d ) j ava . aw t . I t e m E ve nt

2 0. To c r e at e an I n p u t S tr e a m t o r e a d f r o m a fi l e o n a We b s e r ve r , yo u u s e t h e m e t h o d i n t h e U RL c l as s .
( a) o b ta i n I n p u t S t re am ( ) ; ( b ) c o n n e c t S t re am ( ) ; ( c ) o p e n S t r e am ( ) ; ( d ) g e t I n p u t S tr e a m ( );

DABAA CCDBB ABACA CADCC

JAVA ONLINE 9

1 . A n a l yz e t h e f ol l ow i n g c o d e : p u b l i c ab s t r ac t c l a s s Te s t i m p l e m e nts R u n n ab l e { p u b l i c vo i d d o S o m e t h in g ( ) { } ; }
( a) T h e p ro g ra m w i l l n o t c om p i l e b e c au s e i t d o e s n ot c ont ai n ab s t r a c t m e t h o d s . ( b ) R u nt i m e E r ro r .
( c ) T h e p ro g ra m c om p i l e s fi n e . ( d ) T h e p ro g ra m w i l l n o t c om p i l e b e c au s e i t d o e s n ot i m p l e m e nt th e r u n ( ) m e t h o d .

2 . W h i ch o f th e f o l l ow i n g m e t h o d i s a s t at i c i n j ava . l an g . T h r e a d ?
( a) r u n ( ) ( b ) j o i n ( ) ( c ) s l e e p (l o n g) ( d ) s t a rt ( )

3 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) To i nvoke m e t h o d s o n a c o n d i ti o n , t h e l o ck mu s t b e ob t a i n e d fi r s t .
( b ) T h e s i g n al m e th o d on a c on d i t i o n c a u s e s t h e l o ck f o r t h e c on d i t i on t o b e r e l e as e d. ( c ) O n c e yo u i nvo ke t h e awai t m e t h o d o n a c on d i t i on , th e l o ck i s a u to m at i c a l l y re l e as e d . O n c e t h e c o n d i t i on i s r i ght , t h e th r e a d r e - ac qu i r e s t h e l o ck a n d c o nti nu e s e x e c u t i n g . ( d ) A c on d i t i o n i s a s s o c ia t e d w i th a l o ck.

4 . W h i ch o f th e f o l l ow i n g m e t h o d s c an b e u s e d t o r e t u rn a p e r m i t t o a S e m a p h or e s ?
( a) r e l e a s e ( ) ( b ) r e t u r n () ( c ) s e n d ( ) ( d ) a d d ()

5 . W h a t e x c e p t i on ty p e d o e s th e f o l l ow i n g p r o gr a m t h row ? p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { S t r i n g s = “ ab c ”; S y s t e m . o u t. p r i nt l n (s . ch ar At (3 ) ) ; } }
( a) A r r ay I n d e x O u t O f B ou n d s E x c e p t i o n ( b ) A r i t h m e t i c E x c e p t i o n ( c ) C l a s s C as t E x c e p t i on
( d ) S t r i n gI n d e x Ou t O f B o u n d s E x c e pt i o n

6 . W h a t i s w ro n g i n t h e f ol l ow i n g p r og r am ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n ( S t ri n g [ ] a r gs ) { t r y { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } } }
( a) Yo u c an n o t h ave a t r y b l o ck w i t h o u t a c a tch b l o ck .
( b ) N o th i n g i s w r o ng . ( c ) A m e th o d c al l th a t d o e s n ot d e c l ar e e x c e p t i o ns c a n n ot b e p l a c e d i n s i d e a t r y b l o ck . ( d ) Yo u c an n o t h ave a t r y b l o ck w i t h o u t a c a tch b l o ck or a fi n a l l y b l o ck .

7 . P r e s s i n g a b u tt o n g e n e r at e s a (n ) e ve nt .
( a) A c t i o n E ve nt ( b ) I t e m E ve nt ( c ) M o u s e E ve nt ( d ) M o u s e M o t i on E ve nt

8 . T h e h an d l e r (e . g. , ac t i o n Pe r f or m e d ) i s a m e t h o d i n . ( a) b o t h s o u r c e a n d l i s t e n e r ob j e c t ( b ) t h e O b j e c t c l a s s ( c ) a s o u r c e o b j e c t ( d ) a l i s t e n e r ob j e c t

9 . To ch e ck w h e t h e r a D E L E T E ke y i s p re s s e d or r e l e as e d , w h i ch h a n d l e r s h ou l d b e u s e d ?
( a) ke y Typ e d (K e y E ve nt e ) ( b ) ke y Re l e as e d (K e y E ve nt e ) ( c ) ke y A c t i ve ( K e yE ve nt e ) ( d ) ke y I n ac ti ve ( K e y E ve nt e )

1 0. T h e p r e f e r r e d S i z e p ro p e r ty i s i g n o re d i n .
( a) B o r d e r L ayou t ( b ) F l ow Layo u t ( c ) G r i d L ayou t ( d ) Fo r a ny l ayou t

1 1. Yo u c an c on s tr u c t a J Ta b b e d Pa n e u s i n g .
( a) n e w J Ta b b e d Pa n e ( C o m p on e nt ) ( b ) n e w J Ta b b e d Pa n e ( C o m p on e nt [ ] ) ( c ) n e w J Ta b b e d Pa n e ( C o m p on e nt , C om p o n e nt )
( d ) n e w J Ta b b e d Pa n e ( )

1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e a B e ve l B o r d e r ?
( a) n e w B e ve l B or d e r ( ) ( b ) n e w B e ve l B or d e r ( B e ve l B o r d e r . L OW E R E D ) ( c ) B o r d e r Fa c t or y. c r e a t e B e ve l B or d e r ( B e ve l B or d e r . R A I S E D ) ( d ) B o r d e r Fa c t or y. c r e a t e B e ve l B or d e r ( B e ve l B or d e r . L OW E R E D )



1 3. A J C h e ck B ox M e nu I te m i s n ot a s u b c l as s o f .
( a) J M e nu ( b ) J C o m p o n e nt ( c ) J M e nu I t e m ( d ) A b s t r ac tB u t to n

1 4. a l l ow s yo u t o c r e a t e c u s to m b u t t on s .
( a) A n o p t i on d i al o g ( b ) A m e s s a ge d i al o g ( c ) A c on fi r m a ti o n d i a l og ( d ) A n i n p u t d i al o g

1 5. W h a t i s b e s t t o d e s c ri b e t h e r e l a t i on s h i p b e twe e n J C om p on e nt a n d J B u tt o n ? .
( a) I n h e r i t a n c e ( b ) A s s o c i a t i on ( c ) A g gr e g at i o n ( d ) C o m p o s i t i on

1 6. A n a l yz e t h e f ol l ow i n g c o d e . i m p o r t j ava. aw t . *; i m p o r t j avax . s w i n g . * ; p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { J Fr a m e f ra m e = n e w J Fra m e ( “ M y Fr a m e ”) ; f r a m e . ge tC o nt e ntPa n e ( ) . ad d ( n e w J B u t t on ( “ OK ”) ) ; f r a m e . ge tC o nt e ntPa n e ( ) . ad d ( n e w J B u t t on ( “ C an c e l ”) ) ; f r a m e . s e t D e f a u l tC l os e Op e ra t i on ( J Fra m e . E X I T O N C L O S E ) ; f r a m e . s e t S i z e ( 2 00 , 2 00 ) ; f r a m e . s e t V i s i b l e ( t r u e ) ; } }
( a) O n l y b u tt o n C a n c e l i s d i s p l aye d .
( b ) B o t h b u t t o n O K an d b u t t on C a n c e l ar e d i s p l aye d a n d b u t t on O K i s d i s p l aye d on t h e ri g ht s i de o f b u t to n OK . ( c ) B o t h b u t t on OK an d b u t to n C a n c e l ar e d i s p l aye d a n d b u t t o n OK i s d i s p l aye d o n t h e l e f t s i de o f b u t t on OK . ( d ) O n l y b u tt o n O K i s d i s p l aye d .

1 7. T h e m e t h o d s e t s t h e f o nt ( H e l ve ti c a, 20 - p o i nt b o l d ) i n c o m p o n e nt C .
( a) c . s e tFont ( n e w Font ( ”H e l ve t i c a ” , Fo nt. b ol d , 20 ) ) ( b ) c . s e tFont ( n e w Font ( ”h e l ve t i c a ”, B O L D, 20 ) )
( c ) c . s e tFont ( n e w Font ( ”H e l ve t i c a ” , Fo nt. B OL D , 2 0 )) ( d ) c . s e tFont ( Fo nt( ” H e l ve ti c a” , Font . B O L D, 20 ) )

1 8. T h e c o or d i n a te o f t h e u pp e r - l e f t c or n e r o f a f r am e i s .
( a) ( 10 , 1 0 ) ( b ) ( 25 , 2 5 ) ( c ) ( 10 0 , 1 00 ) ( d ) ( 0, 0)

1 9. I f yo u c re at e a J S p i n n e r ob j e c t w i th o u t s p e c i f y i n g a m o d e l , t h e s p i n n e r d i s p l ays .
( a) a s e q u e n c e o f p o s i t i ve i nt e g e r s ( b ) a s e q u e n c e o f d o u b l e val u e s
( c ) a s e q u e n c e o f i nt e g e r s
( d ) a s e q u e n c e o f n o n - n e g a ti ve i nt e g e r s

2 0. Yo u c an ob t a in t h e s e rve r s h os t n a m e by i nvok i n g o n a n a p p le t.
( a) g e t C o d e B a s e ( ) . ge t H o s t N am e ()
( b ) g e t C o d e B a s e ( ) . h os t N a m e ( ) ( c ) g e t C o d e B a s e ( ) . h os t ( )
( d ) g e t C o d e B a s e ( ) . ge t H o s t ( )

CCBCD DADBC DAAAA ACDCD

JAVA ONLINE 8

1 . A n a l yz e t h e f ol l ow i n g c o d e : p u b l i c c l as s Te s t i m p l e m e nt s Ru n n a b l e { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] a r gs ) { T h r e a d t = n e w T h r e a d (t h i s ) ; t . s t ar t ( ) ; } p u b l i c vo i d r u n ( ) { S y s t e m . o u t. p r i nt l n (“ t e s t ” ); } }
( a) T h e p ro g ra m c om p i l e s fi n e , b u t i t d o e s n o t p r i nt any t h i n g b e c a u s e t d o e s n o t i nvo ke t h e ru n ( ) m e t h o d .
( b ) R u nt i m e E r ro r ( c ) T h e p ro g ra m d o e s n o t c om p i l e b e c au s e t h i s c an n o t b e re f e r e n c e d i n a s t a ti c m e t h o d . ( d ) T h e p ro g ra m c om p i l e s a nd r u n s fi n e an d d i s p l ay s te s t o n t h e c on s o l e .

2 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) A s yn ch r o n i z e d i n s ta n c e m e t h o d d o e s n t a c q u i r e a l o ck o n t h e o b j e c t f o r w h i ch th e m e t h o d wa s i nvoke d .
( b ) A s yn ch r o n i z e d i n s ta n c e m e t h o d ac q u i r e s a l o ck on th e c l a s s o f th e ob j e c t f or w h i ch t h e m e t h o d wa s i nvoke d .
( c ) A s yn ch r o n i z e d s ta t e m e nt i s p l ac e d i n s i d e a s y n ch r on i z e d b l o ck. ( d ) A s yn ch r o n i z e d s ta t e m e nt c a n b e u s e d t o a c q u i re a l o ck on a ny ob j e c t , n ot j u s t t h i s o b j e c t , w h e n e x e c u t i n g a b l o ck of t h e c o d e i n a m e t h o d .


3 . Yo u c an n o t c r e a te a b l o ck i ng q u e u e u s i n g .
( a) P r i o ri ty B l o ck i n gQ u e u e ( b ) L i n ke d B l o cki n g Q u e u e ( c ) A r r ay B l o ck i n gQ u e u e ( d ) P r i o ri ty Qu e u e

4 . W h i ch o f th e f o l l ow i n g m e t h o d s c an b e u s e d t o o bt a i n a p e rm i t f ro m a S e m ap h o re s ? ( a) d e l e t e ( ) ( b ) g e t () ( c ) a s k () ( d ) a c q u i re ()

5 . W h a t e x c e p t i on ty p e d o e s th e f o l l ow i n g p r o gr a m t h row ? p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { O b j e c t o = nu l l ; S y s t e m . o u t. p r i nt l n (o ) ; } }
( a) N o e x c e p t i o n ( b ) S t r i n gI n d e x Ou t O f B o u n d s E x c e pt i o n ( c ) A r i t h m e t i c E x c e p t i o n ( d ) A r r ay I n d e x O u t O f B ou n d s E xc e p t i on

6 . W h a t i s d i s p l aye d o n t h e c on s o l e w h e n r u n n i n g t h e f ol l ow i n g p ro g ra m ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { t r y { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); i nt i = 0 ; i nt y = 2 /i ; S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } fi n a l l y { S y s t e m . o u t. p r i nt l n (“ E n d of t he b l o ck ”) ; } S y s t e m . o u t. p r i nt l n (“ E n d of t he b l o ck ”) ; } }
( a) T h e p r og ra m d i s p l ay s We l c o m e t o J ava two t i m e s f o l l owe d by E n d o f t h e b l o ck .
( b ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava two t i m e s f o l l owe d by E n d o f t h e b l o ck two t i m e s .
( c ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava an d E n d o f t h e b l o ck, a n d t h e n te rm i n a t e s b e c a u s e o f an u n h an d l e d e x c e p t i o n . ( d ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava t h re e t i m e s f o ll owe d by E n d o f t h e b l o ck .

7 . W h i ch o f th e f o l l ow i n g s t a t e m e nts r e g i s t e r s a p a n e l o b j e c t p a s a l i s t e n e r f o r a b u t t on va ri a b l e j b t?
( a) j b t . a d d A c t i on E ve nt Li s te n e r (p ) ; ( b ) j b t . a d d E ve nt L i s t e n e r ( p ) ;
( c ) j b t . a d d A c t i on L i s t e n e r ( p ) ; ( d ) a d d A c t i on L i s t e n e r ( p ) ;

8 . E ve r y e ve nt ob j e c t h as t h e m e t h o d .
( a) g e t W h e n ( ) ( b ) g e t A c t i on C o m m an d ( )
( c ) g e t T i m e S t am p ( )
( d ) g e t S ou r c e ( )

9 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) Yo u n e e d n o t al way s s p e c i f y a l i s te n e r w h e n c r e at i n g a T i m e r ob j e c t . ( b ) To s t op a ti m e r , i nvo ke t i m e r. s to p ( ) . ( c ) To s t ar t a t i m e r , i nvoke t i m e r . s t a rt ( ) . ( d ) Yo u c an ad d mu l t i p l e l i s t e n e r s f or a T i m e r ob j e c t .

1 0. S u p p o s e th a t a c o nta i n e r c u s e s a C a rd L ayo u t m a n ag e r p . W h i ch of t h e f o l l ow i n g m e th o d i s n o t va l i d ?
( a) p . l a s t (c ) ( b ) c . p . fi r s t ( ) ( c ) p . p r e v i ou s (c ) ( d ) p . n e x t ( c )

1 1. i s a S w i n g l ayou t m a n a ge r t h a t a rr a n ge s c o m p o n e nts i n a r ow o r a c o l u m n . ( a) B o r d e r L ayou t ( b ) B ox Layo u t ( c ) G r i d L ayou t ( d ) F l ow Layo u t

1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e a Li n e B o rd e r?
( a) n e w L i n e B o r de r( C o l o r. Y E LL OW , 3 , t r u e )
( b ) B o r d e r Fa c t or y. c r e a t e L i n e B o r d e r (C ol o r . Y E L LOW )
( c ) n e w L i n e B o r de r( ) ( d ) n e w L i n e B o r de r( C o l o r. Y E LL OW , 3 )


1 3. W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) Yo u c an ad d a J M e nu t o a J Pop u p M e nu .
( b ) Yo u c an ad d a J C h e ck B ox M e nu I te m t o a J Pop u p M e nu . ( c ) Yo u c an ad d a J M e nu I t e m t o a J Po p u p M e nu . ( d ) Yo u c an ad d a J R a d i oB u tt o n M e nu I t e m to a J Po p u p M e nu .

1 4. W h i ch o f th e f o l l ow i n g s t a t e m e nt i s i n c or r e c t ?
( a) A J To ol B ar i s a G U I c o m p o n e nt, s o i t c a n b e a d d e d t o a c o nt a i n e r . ( b ) A J To ol B ar m ay b e fl oa t ab l e .
( c ) Yo u c an n o t ad d any G U I c om p o n e nt t o a J To o l B a r. ( d ) Y O u c a n s e t or i e nt at i o n o f a J To ol B ar .

1 5. W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) A l l S w i n g G U I c om p o n e nt s a r e l i g htwe i g ht .
( b ) A c ont ai n e r s u ch a s J Fr am e i s a l s o a c o m p o n e nt. ( c ) To d i s t i ng u i s h n e w S w i n g c om p o n e nt c l a s s e s f r o m t h e i r AW T c ou nt e r p a rt s , S w i n g G U I c o m p o n e nt c l as s e s ar e n a m e d w i t h a p r e fi x J . ( d ) A u s e r i nt e r f ac e o b j e c t s u ch a s (b u t t on , l i s t ) c a n a p p e a r i n o n e c ont ai n e r .

1 6. H ow m a ny f r am e s ar e d i s p l aye d ? i m p o r t j avax . s w i n g . * ; p u b l i c c l as s Te s t e xt e n d s J Fr a m e { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { J Fr a m e f 1 = n e w Te s t ( ) ; J Fr a m e f 2 = n e w Te s t ( ) ; J Fr a m e f 3 = n e w Te s t ( ) ; f 1 . s e t V i s i b l e ( t r u e ) ; f 2 . s e t V i s i b l e ( t r u e ) ; f 3 . s e t V i s i b l e ( t r u e ) ; } }
( a) 3 . ( b ) 1 . ( c ) 2 . ( d ) 0 .

1 7. T h e d e f a u l t l ayou t ou t o f a J Pa n e l i s . ( a) B o r d e r L ayou t ( b ) G r i d L ayou t ( c ) F l ow Layo u t ( d ) d e f a u l t L ayou t

1 8. G i ve n a G r a p h i c s o b j e c t g, t o d r aw a p o l y go n t o c on n e c t p oi nt s ( 3 , 3) , ( 4 , 10 ) , (1 0 , 20 ), ( 2 , 10 0 ), yo u u s e
( a) g . d raw Po l yl i n e ( 3 , 4 , 1 0, 2, 3, 10 , 2 0, 10 0 , 4 )
( b ) g . d raw Po l yg on ( n e w i nt [ ] 3, 4, 1 0 , 2 , n e w i nt[ ] 3 , 1 0, 20 , 1 0 0, 4 ) ( c ) g . d raw Po l yl i n e ( n e w i nt [ ] 3, 4, 1 0 , 2 , n e w i nt[ ] 3 , 1 0, 20 , 1 0 0, 4 ) ( d ) g . d raw Po l yg on ( 3 , 4 , 1 0, 2, 3, 10 , 2 0, 10 0 , 4 )

1 9. J L i s t fi r e s w h e n a n e w i t e m i s s e l e c t e d .
( a) j ava x. s w i n g. e ve nt . C h a n ge E ve nt
( b ) j ava x. s w i n g. e ve nt . A d j u s t m e nt E ve nt ( c ) j ava . aw t . e ve nt. I te m E ve nt ( d ) j ava . aw t . A c t i on E ve nt

2 0. W h e n c r e at i n g a s e r ve r o n a p o r t t h at i s a l re ad y i n u s e , .
( a) t h e s e r ve r i s b l o cke d u nt i l t h e p o r t i s ava i l a b l e . ( b ) t h e s e r ve r e n c ou nt e r s a f at a l e r r or an d mu s t b e te r m i n a t e d .
( c ) t h e s e r ve r i s c r e a t e d w i t h n o p ro b l e m s .
( d ) j ava . n e t . B i n d E x c e p t i o n o c c u r s .


CADDA CCDAB BCACA ACBAD

JAVA ONLINE 7

1 . W hy d o e s th e f o l l ow i n g c l a s s h ave a s ynt ax e r ro r ? i m p o r t j ava. a p p l e t . *; p u b l i c c l as s Te s t e x t e n d s A p p l e t i m p l e m e nt s Ru n n a b l e { p u b l i c vo i d i n i t ( ) t h row s I nte rr u p t e d E x c e p t i o n { T h r e a d t = n e w T h r e a d (t h i s ) ; t . s l e e p ( 1 00 0) ; } p u b l i c s y n ch r o n i z e d vo i d r u n ( ) { } }
( a) Yo u c an n o t p u t t h e ke y wor d s y n ch ro n i z e d i n t h e r u n ( ) m e t h o d .
( b ) T h e i n i t ( ) m e t h o d i s d e fi n e d i n t h e A p p l e t c l a s s , a n d i t i s ove r ri d d e n i n c o r r e c t l y b e c au s e i t c an n o t c l ai m e x c e p t i o n s i n th e s u b c l as s . ( c ) T h e s l e e p ( ) m e t h o d i s n o t i nvo ke d c o rr e c tl y ; i t s h ou l d b e i nvoke d as T h r e a d . s l e e p ( 10 0 0) . ( d ) T h e s l e e p ( ) m e t h o d s h ou l d b e p u t i n t h e t r y- c a tch b l o ck. T h i s i s t h e o n l y r e a s on f or th e c o m p i l at i o n f a i l u r e .

2 . H ow d o you c re at e a c as h e d t h r e ad p o ol ?
( a) E x e c u t o rS e rv i c e e x e c u t o r = E x e c u t o rs . n e w C a ch e d T h r e a d Po o l ( 1) ;
( b ) E x e c u t o rS e rv i c e e x e c u t o r = E x e c u t o rs . n e w C a ch e d T h r e a d Po o l ( 2) ;
( c ) E x e c u t o rS e rv i c e e x e c u t o r = E x e c u t o rs . n e w C a ch e d T h r e a d Po o l ( 3)
; ( d ) E x e c u t o rS e rv i c e e x e c u t o r = E x e c u t o rs . n e w C a ch e d T h r e a d Po o l ( );

3 . W h i ch m e t h o d o n a c o n d i t i on s h o u l d yo u i nvoke t o c a u s e s t h e c u r r e nt t h r e a d t o wai t u nti l t h e c o n d i ti o n i s s i g n al e d ?
( a) c o n d i t i on . awa i t ( ); ( b ) c o n d i t i on . wa i te d () ; ( c ) c o n d i t i on . wa i t( ) ; ( d ) c o n d i t i on . wa i ti n g ( ) ;

4 . W h i ch o f th e f o l l ow i n g m e t h o d s c an b e u s e d t o o bt a i n a p e rm i t f ro m a S e m ap h o re s ?
( a) a c q u i re () ( b ) a s k () ( c ) d e l e t e ( ) ( d ) g e t ()

5 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) Yo u u s e t h e ke y wo rd t h row s to d e c l ar e e x c e p t i on s i n t h e m e t h o d h e ad i n g . ( b ) I f a ch e cke d e x c e p ti o n o c c u rs i n a m e th o d , i t n e e d n ot t o b e e i t h e r c au g ht or d e c l a re d t o b e th r ow n f r o m t h e m e t h o d . ( c ) A m e th o d may d e c l a r e t o t h r ow mu l t i p l e e x c e p t i on s .
( d ) To th r ow a n e x c e p t i o n , u s e t h e ke y wo r d t h row .

6 . W h a t i s d i s p l aye d o n t h e c on s o l e w h e n r u n n i n g t h e f ol l ow i n g p ro g ra m ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { t r y { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); i nt i = 0 ; i nt y = 2 /i ; S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } c a t ch ( Ru nt i m e E x c e p t i o n e x ) { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } fi n a l l y { S y s t e m . o u t. p r i nt l n (“ E n d of t he b l o ck ”) ; } S y s t e m . o u t. p r i nt l n (“ E n d of t he b l o ck ”) ; } }
( a) T h e p r og ra m d i s p l ay s We l c o m e t o J ava two t i m e s f o l l owe d by E n d o f t h e b l o ck . ( b ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava t h re e t i m e s f o ll owe d by E n d o f t h e b l o ck .
( c ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava two t i m e s f o l l owe d by E n d o f t h e b l o ck two t i m e s .
( d ) Yo u c an n o t c a tch Ru nt i m e E x c e p t i o n e r r o rs .

7 . W h i ch o f th e f o l l ow i n g i s f a l s e ?
( a) u s e as s e r t i on s f o r ar g u m e nt ch e ck i n g i n p u b l i c m e t ho d s .
( b ) U s e as s e r t i on s t o re affi r m a s s u m p t i o n s . ( c ) E x c e p t i o n h a n d l i n g ad d r e s s e s r o b u s t n e s s w h e r e a s a s s e r t i o n a d d re s s e s c o rr e c tn e s s . ( d ) E x c e p t i o n h a n d l i n g d e a l s w i t h u nu s u a l c i r c u m s ta n c e s d u r i n g p r og r am e x e c u t i o n . A s s e r t i on s a r e i nt e n d e d t o e n s u r e t h e c o r re c t n e s s of t h e p r og r am .











8 . A n a l yz e t h e f ol l ow i n g c o d e . 1 . i m p o rt j ava . aw t. * ; 2 . i m p o rt j ava . aw t. e ve nt . *; 3 . i m p o rt j ava x . s w i n g . *; 4 . 5 . p u b l i c c l a s s Te s t e x t e n d s J Fr am e { 6 . p u b l i c Te s t ( ) { 7 . J B u t t on j b t OK = n e w J B u t t on ( “ OK ” ) ; 8 . J B u t t on j b t C an c e l = n e w J B u t t on ( “ C a n c e l ” ); 9 . ge tC ont e ntPa n e ( ) . ad d ( j b t O K ) ; 1 0. g e t C o nt e nt Pa n e ( ). a d d ( j b t C an c e l ) ; 1 1. j b tO K . a d d A c t i on L i s t e n e r ( t h i s ) ; 1 2. j b tC an c e l . a d d A c t i o n Li s te n e r (t h i s ) ; 1 3. } 1 4. 1 5. p u b l i c vo i d a c t i o n p e r f or m e d ( A c t i o n E ve nt e ) { 1 6. S y s t e m . o u t . p ri nt l n ( “A b u t to n i s c l i cke d ”) ; 1 7. } 1 8. 1 9. p u b l i c s t at i c vo i d m a i n ( S tr i n g [ ] a r gs ) { 2 0. J Fr am e f r am e = n e w Te s t( ) ; 2 1. f ra m e . s e tS i z e (3 0 0, 30 0) ; 2 2. f ra m e . s e tD e f a u l t C l o s e O p e r at i o n (J Fr am e . E X I T O N C L O S E ) ; 2 3. f ra m e . s e tV i s i b l e (t r u e ) ; 2 4. } 2 5. }

( a) T h e p r og ra m h a s s y nt a x e r r or s on Li n e 1 5 b e c a u s e th e s i g n at u r e o f ac t i o n p e r f o rm e d i s w r on g . ( b ) T h e p r og r am h as r u nt i m e e rr o r s o n Li n e s 9 an d 10 b e c a u s e j b t OK an d j b t C a n c e l ar e ad d e d t o t h e s a m e l o c a t i on i n t h e c ont a i n e r . ( c ) T h e p r og ra m h a s s y nt a x e r r or s on Li n e 2 0 b e c a u s e n e w Te s t ( ) i s as s i gn e d t o f r am e (a var i a b l e o f J Fr am e ) .
( d ) T h e p r og ra m h a s s y nt a x e r r or s on Li n e s 1 1 an d 12 b e c au s e Te s t d o e s n o t i m p l e m e nt A c t i o n Li s te n e r .

9 . T h e ge tK e y C o d e () m e t h o d of t h e K e yE ve nt r e t u r n s .
( a) t h e E B S D I C c o d e o f t h e ch ar a c t e r
( b ) t h e U n i c o d e c o d e o f th e ch ar a c t e r ( c ) a ch a ra c t e r ( d ) t h e A S C I I c o d e o f t h e ch ar a c t e r

1 0. c a n n ot b e s h ar e d by a G U I c om p o n e nt ?
( a) A Font o b j e c t
( b ) A C ol o r o b j e c t
( c ) A l ayo u t o b j e c t
( d ) A G U I c om p o n e nt

1 1. Yo u c an c on s tr u c t a J Ta b b e d Pa n e u s i n g .
( a) n e w J Ta b b e d Pa n e ( C o m p on e nt [ ] )
( b ) n e w J Ta b b e d Pa n e ( )
( c ) n e w J Ta b b e d Pa n e ( C o m p on e nt )
( d ) n e w J Ta b b e d Pa n e ( C o m p on e nt , C om p o n e nt )

1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e a Li n e B o rd e r?
( a) n e w L i n e B o rd e r( C o l o r. Y E LL OW , 3 , t r u e )
( b ) n e w L i n e B o rd e r( C o l o r. Y E LL OW , 3 )
( c ) n e w L i n e B o rd e r( )
( d ) B o r d e r Fa c t or y. c r e a t e L i n e B o r d e r (C ol o r . Y E L LOW )

1 3. Yo u c an n o t s e t an i m a g e I c o n p r o p e r ty o n .
( a) a J C h e ck B ox M e nu I t e m
( b ) a J M e nu I t e m
( c ) a J R ad i o B u t t on M e nu I te m
( d ) a J m e nu B a r


1 4. a re r e f e r r e d t o a s h e av y we i ght c o m p o n e nts .
( a) G U I c o m p on e nt s
( b ) N o n - G U I c o m p on e nt s
( c ) S w i n g c o m p o n e nts
( d ) AW T c o m p on e nt s

1 5. W h i ch o f th e f o l l ow i n g c l a s s e s i s a h e av y we i g ht c o m p o ne nt ?
( a) J Pa n e l ( b ) J Fr a m e ( c ) J B u t t o n ( d ) J Te x tF i e l d

1 6. H ow m a ny f r am e s ar e d i s p l aye d ? i m p o r t j avax . s w i n g . * ; p u b l i c c l as s Te s t e x t e n d s J Fr a m e { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { J Fr a m e f 1 = n e w Te s t ( ) ; J Fr a m e f 2 = n e w Te s t ( ) ; J Fr a m e f 3 = n e w Te s t ( ) ; f 1 . s e t V i s i b l e ( t r u e ) ; f 2 . s e t V i s i b l e ( t r u e ) ; f 3 . s e t V i s i b l e ( t r u e ) ; } }
( a) 1 . ( b ) 3 . ( c ) 2 . ( d ) 0 .

1 7. T h e m e t h o d s e t s t h e f o r e gr o u n d c o l o r t o ye l l ow i n J Fr am e f .
( a) s e t For e g r ou n d ( C o l or . Y E L L OW )
( b ) f . s e tFor e G ro u n d ( C o l or . ye l l ow )
( c ) s e t For e g r ou n d ( C o l or . ye l l ow )
( d ) f . s e tFor e g r ou n d ( C o l or . ye l l ow )




1 8. G i ve n a G r a p h i c s o b j e c t g, t o d r aw a p o l y go n t o c on n e c t p oi nt s ( 3 , 3) , ( 4 , 10 ) , (1 0 , 20 ) , (2 , 1 00 ), yo u u s e
( a) g . d raw Po l yg on ( n e w i nt [ ] 3, 4 , 1 0 , 2 , n e w i nt [ ] 3 , 1 0, 20 , 1 0 0, 4 )
( b ) g . d raw Po l yl i n e ( 3 , 4 , 1 0, 2, 3, 10 , 2 0, 10 0 , 4)
( c ) g . d raw Po l yg on ( 3 , 4 , 1 0, 2, 3, 10 , 2 0, 10 0 , 4)
( d ) g . d raw Po l yl i n e ( n e w i nt [ ] 3, 4 , 1 0 , 2 , n e w i nt [ ] 3 , 1 0, 20 , 1 0 0, 4 )


1 9. I f yo u c re at e a J S p i n n e r ob j e c t w i th o u t s p e c i f y i n g a m o d e l , t h e s p i n n e r d i s p l ays .
( a) a s e q u e n c e o f d o u b l e val u e s
( b ) a s e q u e n c e o f n o n - n e g a ti ve i nt e g e r s
( c ) a s e q u e n c e o f p o s i t i ve i nt e g e r s
( d ) a s e q u e n c e o f i nt e g e r s

2 0. To c r e at e an I n p u t S tr e a m o n a s o cke t s , yo u u s e .
( a) I n p u t S t r e am i n = s . g e t S t re am ( ) ;
( b ) I n p u t S t r e am i n = s . g e t I n p u t S t re am ( ) ;
( c ) I n p u t S t r e am i n = n e w I n p u t S t re a m ( s ) ;
( d ) I n p u t S t r e am i n = s . o b t ai n I n p u t S t r e am ( ) ;


B D A A B C A D B D B C D D B B D A D B

JAVA ONLINE 6

1 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s n o t d e fi n e d i n t h e Ob j e c t c l a s s ? ( a) wa i t( ) ( b ) n o ti f y( ) ( c ) n o ti f yA l l ( ) ( d ) s l e e p (l o n g m i l l i s e c o n d s )

2 . W h i ch o f th e f o l l ow i n g m e t h o d i s a s t at i c i n j ava . l an g . T h r e a d ? ( a) s l e e p (l o n g) ( b ) s t a rt ( ) ( c ) r u n ( ) ( d ) j o i n ( )

3 . Yo u c an n o t c r e a te a b l o ck i ng q u e u e u s i n g . ( a) A r r ay B l o ck i n gQ u e u e ( b ) P r i o ri ty B l o ck i n gQ u e u e ( c ) L i n ke d B l o cki n g Q u e u e ( d ) P r i o ri ty Qu e u e

4 . A J ava e x c e p ti o n i s an i n s t an c e o f . ( a) E r r or ( b ) T h r owa b l e ( c ) R u nt i m e E x c e p t i on ( d ) E x c e p t i o n

5 . W h a t e x c e p t i on ty p e d o e s th e f o l l ow i n g p r o gr am t h row ? p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { S t r i n g s = “ ab c ”; S y s t e m . o u t. p r i nt l n (s . ch ar At (3 ) ) ; } } ( a) A r r ay I n d e x O u t O f B ou n d s E x c e p t i o n ( b ) S t r i n gI n d e x Ou t O f B o u n d s E x c e pt i o n ( c ) A r i t h m e t i c E x c e p t i o n ( d ) C l a s s C as t E x c e p t i on

6 . W h i ch o f th e f o l l ow i n g i s n ot an a d va nt ag e o f J ava e x c e p ti o n h a n d l i n g? ( a) E x c e p t i o n h a n d l i n g i m p rove s p e r f o r m an c e . ( b ) J ava s e p a r at e s e x c e p t i on h an d l i n g f r o m n o r m al p r o c e s s i n g t as k s . ( c ) E x c e p t i o n h a n d l i n g m ake s i t p os s i b l e f or t h e c a l l e r’ s c a l l e r t o h a n d l e t h e e xc e p t i on . ( d ) E x c e p t i o n h an d l i n g s i m p l i fi e s p r og r am m i n g b e c a u s e t h e e r r or - re p or t i n g a n d e r r or - h a n d l i n g c o d e c an b e p l a c e d a t t h e c a t ch b l o ck .

7 . C l i ck i n g t h e c l o s i n g b u t t on on th e u p p e r - ri g ht c o rn e r of a f r am e g e n e r at e s a (n ) e ve nt . ( a) W i n d ow E ve nt ( b ) C o m p o ne nt E ve nt ( c ) M o u s e M o t i on E ve nt ( d ) I t e m E ve nt

8 . To ge t th e x c o o rd i n a t e o f t h e m ou s e p o i nt e r f o r t h e M o u s e E ve nt e vt , yo u u s e . ( a) E ve nt . ge t Po i nt ( ) . x ( b ) E ve nt . ge t Po i nt ( x , y ) ( c ) e v t . ge tX ( ) ( d ) e v t . ge tX Y ( )

9 . W h i ch o f th e f o l l ow i n g p r o p e r ti e s a r e i n J A p p l e t ? ( a) r e s i z a b l e ( b ) i c o n I m a ge ( c ) c o nte nt Pa n e ( d ) t i t l e

1 0. W h i ch o f th e f o l l ow i n g p r o p e r ti e s i n j ava. aw t . C om p o n e nt m ay e ff e c t l ayou t ? ( a) p r e f e r r e d S i z e ( b ) b a ckg r ou n d ( c ) f o nt ( d ) f o r e gr o u n d


1 1. Yo u c an c on s tr u c t a J S p l i t Pa n e u s i n g . ( a) n e w J S p l i tPan e ( C o m p o n e nt, C om p on e nt ) ( b ) n e w J S p l i tPan e ( ) ( c ) n e w J S p l i tPan e ( C o m p o n e nt [ ] ) ( d ) n e w J S p l i tPan e ( C o m p o n e nt)

1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e an E t ch e d B o r d e r? ( a) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( C ol o r . Y E L L OW , C ol o r . RE D ) ( b ) n e w E t ch e d B o ar d e r ( ) ( c ) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( ) ( d ) n e w E t ch e d B o r d e r (C ol o r . Y E L LOW , C o l o r. R E D )


1 3. A J R a d i oB u tt o n M e nu I t e m is a s u b c l as s o f . ( a) J M e nu I t e m ( b ) A b s t r ac tB u t to n ( c ) J M e nu ( d ) J C o m p o n e nt

1 4. i s u s e d t o r e c e i ve i n p u t f r om th e u s e r . ( a) A n i n p u t d i al o g ( b ) A m e s s a ge d i al o g ( c ) A c on fi r m a ti o n d i a l og ( d ) A n o p t i on d i al o g

1 5. W h i ch o f th e f o l l ow i n g c l a s s e s a r e n o t i n t h e j ava. aw t p ackag e ? ( a) Fo nt ( b ) J Fr a m e ( c ) C o l or ( d ) C o m p o n e nt

1 6. To s e t a F l ow L ayo u t i n p an e l j p , you c a n u s e t h e m e t h o d . ( a) j p . s e tL ayo u t (n e w F l ow Layo u t ( F l ow L ayou t . c e nt e r ) ) ; ( b ) j p . s e tL ayo u t (n e w F l ow Layo u t ( )) ; ( c ) j p . s e tL ayo u t (n e w F l ow Layo u t ( F l ow L ayou t ) ) ; ( d ) j p . s e tL ayo u t (F l ow L ayou t ( ) );

1 7. T h e m e t h o d s e t s t h e b a ckg r ou n d c o l or t o ye l l ow i n J Fra m e f . ( a) s e t B ack g ro u n d ( C ol o r . Y E L L OW ) ( b ) s e t B ack g ro u n d ( C ol o r . ye l l ow ) ( c ) f . s e tB ack G r o u n d ( C ol o r . ye l l ow ) ( d ) f . s e tB ack g r ou n d ( C o l or . Y E L L OW )

1 8. W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ? ( a) T h e p ai nt C o m p on e nt me th o d i s a u t om a t i c al l y i nvoke d by t h e J V M . Yo u s h o u l d n e ve r i nvoke i t d i r e c tl y. ( b ) W h e n e ve r a G U I c o m p o n e nt i s di s p l aye d , i t s G r ap h i c s o b j e c t i s a u t om a t i c al l y c r e at e d . ( c ) I nvok i n g r e p ai nt ( ) c a u s e s p ai nt C o m p on e nt to b e i nvo ke d by t h e J V M . ( d ) Yo u m ay c r e a te a G r a p h i c s o b j e c t u s i n g n e w G r a p h i c s ( ) .

1 9. D e f a u l t Li s tC e l l Re n de re r c a n d i s p l ay . ( a) b o t h s t r i n g an d i c on ( b ) a s t r i n g or an i c on ( c ) o n l y an i c on ( d ) o n l y a s t r i n g

2 0. To c r e at e an I n p u t S tr e a m t o r e a d f r o m a fi l e o n a We b s e r ve r , yo u u s e t h e m e t h o d i n t h e U RL c l as s . ( a) c o n n e c t S t re am ( ) ; ( b ) g e t I n p u t S tr e a m ( ); ( c ) o b ta i n I n p u t S t re am ( ) ; ( d ) o p e n S t r e am ( ) ;

D A D B B A A C C A B B C A B B D D B D

JAVA ONLINE 5

1 . Yo u c an u s e t h e m e t h o d t o t e m p o ra r i l y t o re l e as e t i m e f or o t h e r t h r e a d s .
( a) s u s p e n d ( )
( b ) y i e l d ( )
( c ) s t o p ()
( d ) s l e e p (i nt m i l l i s e c on d s )

2 . W h i ch o f th e f o l l ow i n g m e t h o d i s a s t at i c i n j ava . l an g . T h r e a d ?
( a) j o i n ( )
( b ) r u n ( )
( c ) s l e e p (l o n g)
( d ) s t a rt ( )

3 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) A b l o ck i n g q u e u e c au s e s a t h r e ad t o b l o ck w h e n you t ry to r e m ove an e l e m e nt f r o m a n e m p ty q u e u e .
( b ) a b l o cki n g q u e u e h a s a c a p ac i ty.
( c ) A b l o ck i n g q u e u e c au s e s a t h r e ad t o b l o ck w h e n you t ry to a d d a n e l e m e nt t o a f u l l q u e u e .
( d ) T h e B l o ck i n gQ u e u e i nt e r f a c e i s t h e d e r i ve d i nt e r f a c e f o r al l c on c re te b l o cki n g q u e u e c l a s s e s .

4 . W h a t e x c e p t i on ty p e d o e s th e f o l l ow i n g p r o gr am t h row ? p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { S y s t e m . o u t. p r i nt l n (1 / 0 ) ; } }
( a) S t r i n gI n d e xO u t Of B ou n d s E x c e p t i on
( b ) C l a s s C a s t E x c e p t i o n
( c ) A r i t h m e t i c E x c e p t i on
( d ) A r r ay I n d e x O u tO f B o u n d s E x c e p ti o n

5 . W h a t e x c e p t i on ty p e d o e s th e f o l l ow i n g p r o gr am t h row ? p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { O b j e c t o = nu l l ; S y s t e m . o u t. p r i nt l n (o . t oS t r i n g( ) ) ; } }
( a) S t r i n gI n d e x Ou t O f B o u n d s E x c e pt i o n
( b ) A r r ay I n d e x O u t O f B ou n d s E x c e p t i o n
( c ) C l a s s C as t E x c e p t i on
( d ) A r i t h m e t i c E x c e p t i o n

6 . W h a t i s d i s p l aye d o n t h e c on s o l e w h e n r u n n i n g t h e f o l l ow i n g p ro g ra m ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n ( S t ri n g [ ] a r gs ) { t r y { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ) ; } fi n a l l y { S y s t e m . o u t. p r i nt l n (“ T h e fi n al l y c l au s e i s e x e c u t e d ”) ; } } }
( a) We l c om e t o J ava f ol l owe d by T h e fi n al l y c l au s e i s e x e c u t e d i n t h e n e x t l i n e ( b ) T h e fi n al l y c l au s e i s e x e c u t e d
( c ) R u nt i m e E r ro r
( d ) We l c om e t o J ava

7 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) I f a c o m p on e nt c an ge n e r a t e a n e ve nt , a ny s u b c l a s s of t h e c o m p o n e nt c an n o t g e n e r a te t h e s a m e ty p e of e ve nt.
( b ) a c o m p on e nt on w h i ch a n e ve nt i s ge n e ra t e d i s c a l l e d t h e s ou r c e ob j e c t .
( c ) E ve r y G U I c o m p on e nt c an ge n e ra t e M ou s e E ve nt , K e y E ve nt , Fo c u s E ve nt , a n d C o m p o n e ntE ve nt .
( d ) A l l t h e e ve nt c l as s e s ar e s u b c l a s s e s o f E ve nt Ob j e c t .





8 . T h e m e t h o d i n t h e A c t i on E ve nt r e t u r n s t h e a c t i o n c o m m an d of t h e b u t t on .( a) g e t A c t i on C o m m an d ( )
( b ) p a ra m S t ri n g ( )
( c ) g e t I D ()
( d ) g e t M o d i fi e r s ( )

9 . To ch e ck w h e t h e r a D E L E T E ke y i s p re s s e d or r e l e as e d , w h i ch h a n d l e r s h ou l d b e u s e d ?
( a) ke y A c t i ve ( K e yE ve nt e )
( b ) ke y Typ e d (K e y E ve nt e )
( c ) ke y I n ac ti ve ( K e y E ve nt e )
( d ) ke y Re l e as e d (K e y E ve nt e )

1 0. S u p p o s e th a t a c o nta i n e r c u s e s a C a rd L ayo u t m a n ag e r p . W h i ch of t he f o l l ow i n g m e th o d i s n o t va l i d ?
( a) c . p . fi r s t ( )
( b ) p . n e x t ( c )
( c ) p . l a s t (c )
( d ) p . p r e v i ou s (c )

1 1. i s a S w i n g l ayou t m a n a ge r t h a t a rr a n ge s c o m p o n e nts i n a r ow o r a c o l u m n . ( a) B o r d e r L ayou t
( b ) G r i d L ayou t
( c ) B ox Layo u t
( d ) F l ow Layo u t

1 2. A J M e nu I t e m i s a s u b c l a s s of .
( a) J C o nta i n e r
( b ) J M e nu
( c ) A b s t r ac tB u t to n
( d ) J B u t t o n

1 3. A J C h e ck B ox M e nu I te m i s n ot a s u b c l as s o f .
( a) J M e nu
( b ) J C o m p o n e nt
( c ) J M e nu I t e m
( d ) A b s t r ac tB u t to n

1 4. a l l ow s yo u t o c r e a t e c u s to m b u t t on s .
( a) A n i n p u t d i al o g
( b ) A c on fi r m a ti o n d i a l og
( c ) A n o p t i on d i al o g
( d ) A m e s s a ge d i al o g

1 5. W h a t i s b e s t t o d e s c ri b e t h e r e l a t i on s h i p b e twe e n J C om p on e nt a n d J B u tt o n ? .
( a) C o m p o s i t i on
( b ) A s s o c i a t i on
( c ) A g gr e g at i o n
( d ) I n h e r i t a n c e









1 6. A n a l yz e t h e f ol l ow i n g c o d e . i m p o r t j ava. aw t . *; i m p o r t j avax . s w i n g . * ; p u b l i c c l as s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { J Fr a m e f ra m e = n e w J Fra m e ( “ M y Fr a m e ”) ; f r a m e . ge tC o nt e ntPa n e ( ) . ad d ( n e w J B u t t on ( “ OK ”) ) ; f r a m e . ge tC o nt e ntPa n e ( ) . ad d ( n e w J B u t t on ( “ C an c e l ”) ) ; f r a m e . s e t D e f a u l tC l os e Op e ra t i on ( J Fra m e . E X I T O N C L O S E ) ; f r a m e . s e t S i z e ( 2 00 , 2 00 ) ; f r a m e . s e t V i s i b l e ( t r u e ) ; } }
( a) B o t h b u t t on OK an d b u t to n C a n c e l ar e d i s p l aye d a n d b u t t o n OK i s d i s p l aye d o n t h e l e f t s i de o f b u t t on OK .
( b ) O n l y b u tt o n O K i s d i s p l aye d .
( c ) O n l y b u tt o n C a n c e l i s d i s p l aye d .
( d ) B o t h b u t t o n O K an d b u t t on C a n c e l ar e d i s p l aye d a n d b u t t on O K i s d i s p l aye d on t h e ri g ht s i d e o f b u t to n OK .

1 7. T h e m e t h o d c a n b e u s e d to g e t t h e w i d t h o f t h e c om p o n e nt c .
( a) c . g e t S i z e ( )
( b ) c . g e t H e i g ht ( )
( c ) c . g e t D i m e n s i on ( )
( d ) c . g e t W i d t h ()

1 8. T h e c o or d i n a te o f t h e u pp e r - l e f t c or n e r of a f r am e i s .
( a) ( 25 , 2 5 )
( b ) ( 10 , 1 0 )
( c ) ( 0, 0)
( d ) ( 10 0 , 1 00 )

1 9. I f yo u c re at e a J S p i n n e r ob j e c t w i th o u t s p e c i f y i n g a m o d e l , t h e s p i n n e r d i s p l ays .
( a) a s e q u e n c e o f n o n - n e g a ti ve i nt e g e r s
( b ) a s e q u e n c e o f p o s i t i ve i nt e g e r s
( c ) a s e q u e n c e o f i nt e g e r s
( d ) a s e q u e n c e o f d o u b l e val u e s

2 0. Yo u c an ob t a in t h e s e rve r s h os t n a m e by i nvok i n g o n a n a p p l e t.
( a) g e t C o d e B a s e ( ) . ge t H o s t ( )
( b ) g e t C o d e B a s e ( ) . h os t N a m e ( )
( c ) g e t C o d e B a s e ( ) . ge t H o s t N am e ()
( d ) g e t C o d e B a s e ( ) . h os t ( )

B C D C A
A A A D A
C C A C D
C D C C A

JAVA ONLINE 4

1 . The following method in the Thread class is not deprecated :
( a) y i e l d ( )
( b ) s u s p e n d ( );
( c ) r e s u m e ( ) ;
( d ) s t o p () ;

2 . W h i ch o f th e f o l l ow i n g m e t h o d i s a s t at i c i n j ava . l an g . T h r e a d ?
( a) s l e e p (l o n g)
( b ) r u n ( )
( c ) s t a rt ( )
( d ) j o i n ( )

3 . W h i ch o f th e f o l l ow i n g s t a t e m e nt i s f al s e ?
( a) O n c e yo u i nvo ke t h e awai t m e t h o d o n a c on d i t i on , th e l o ck i s a u to m at i c a l l y re l e as e d . O n c e t h e c o n d i t i on i s r i ght , t h e th r e a d r e - ac q u i r e s t h e l o ck a n d c o nti nu e s e x e c u t i n g .
( b ) A c on d i t i o n i s a s s o c ia t e d w i th a l o ck.
( c ) To i nvoke m e t h o d s o n a c o n d i ti o n , t h e l o ck mu s t b e ob t a i n e d fi r s t .
( d ) T h e s i g n al m e th o d on a c on d i t i o n c a u s e s t h e l o ck f o r t h e c on d i t i on t o b e r e l e as e d.

4 . T h e f o l l ow i n g c o d e c au s e s J ava t o t h row . i nt nu mb e r = I nt e g e r . M A X VA L U E + 1 ;
( a) E x c e p t i o n
( b ) R u nt i m e E x c e p t i on
( c ) E r r or
( d ) N o E x c e p t i o n s

5 . A n a l yz e t h e f ol l ow i n g p r og r am . c l a s s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { t r y { S t r i n g s = ” 5. 6 ”; I nt e g e r . p ar s e I nt ( s ) ; / / C a u s e a N u mb e rFor m a t E x c e p t i o n i nt i = 0 ; i nt y = 2 / i ; S y s t e m . o u t. p r i nt l n (” We l c om e t o J ava ” ); } c a t ch ( E x c e p t i on e x ) { S y s t e m . o u t. p r i nt l n (e x) ; } } }
( a) A n e xc e p t i on i s r ai s e d d u e t o 2 / i ;
( b ) T h e p r og ra m c om p i l e s a n d r u n s w i t h o u t e x c e p t i o n s .
( c ) T h e p r og ra m h a s a c om p i l a t i on e r ro r .
( d ) A n e xc e p t i on i s r ai s e d d u e t o I nte ge r . p a rs e I nt (s );

6 . W h a t i s w ro n g i n t h e f ol l ow i n g p r og r am ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n ( S t ri n g [ ] a r gs ) { t r y { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } } }
( a) Yo u c an n o t h ave a t r y b l o ck w i t h o u t a c a tch b l o ck or a fi n a l l y b l o ck .
( b ) A m e th o d c al l th a t d o e s n ot d e c l ar e e x c e p t i o ns c a n n ot b e p l a c e d i n s i d e a t r y b l o ck .
( c ) N o th i n g i s w r o ng .
( d ) Yo u c an n o t h ave a t r y b l o ck w i t h o u t a c a tch b l o ck .

7 . W h i ch o f th e f o l l ow i n g i s n ot a c or r e c t a s s e rt i o n s t a t e m e nt?
( a) a s s e r t s u m > 1 0 && s u m < 5 * 1 0 : “s um i s ” + s u m ;
( b ) a s s e r t ( i < 1 0) ;
( c ) a s s e r t “ s u m i s ” + s u m ;
( d ) a s s e r t ( i > 1 0) ;

8 . To b e a l i s te ne r f o r A c t i on E ve nt , a n o b j e c t mu s t b e an i n s t an c e o f .
( a) W i n d ow Li s te n e r
( b ) A c t i o n E ve nt
( c ) E ve nt Ob j e c t
( d ) A c t i o n Li s te n e r

9 . To ch e ck w h e t h e r a D E L E T E ke y i s p re s s e d or r e l e as e d , w h i ch h a n d l e r s h ou l d b e u s e d ?
( a) ke y A c t i ve ( K e yE ve nt e )
( b ) ke y Typ e d (K e y E ve nt e )
( c ) ke y Re l e as e d (K e y E ve nt e )
( d ) ke y I n ac ti ve ( K e y E ve nt e )

1 0. W h i ch o f th e f o l l ow i n g p r o p e r ti e s i n j ava. aw t . C om p o n e nt m ay e ff e c t l ayou t ?
( a) p r e f e r r e d S i z e
( b ) b a ckg r ou n d
( c ) f o r e gr o u n d
( d ) f o nt

1 1. W h i ch o f th e f o l l ow i n g a r e t h e i nval i d m e t h o d s i n J Tab b e d Pan e ?
( a) g e t T i t l e At( i n d e x )
( b ) g e t Ta b b e d C o u nt( )
( c ) g e t To o l T i p Te x t At (i n d e x)
( d ) g e t Ta b P l a c e m e nt ( )

1 2. W h i ch o f th e f o l l ow i n g m e t h o d w i l l n ot c r e at e an E t ch e d B o r d e r ?
( a) n e w E t ch e d B o r d e r (C ol o r . Y E L LOW , C o l o r. R E D )
( b ) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( )
( c ) n e w E t ch e d B o ar d e r ( )
( d ) B o r d e r Fa c t or y. c r e a t e E t ch e d B or d e r ( C ol o r . Y E L L OW , C ol o r . RE D )



1 3. i s th e a c t i on t h a t c a u s e s a p o p u p m e nu t o b e d i s p l aye d .
( a) Po p u p r e a c ti o n
( b ) Po p u p e ve nt
( c ) Po p u p t r i gg e r
( d ) Po p u p a c t io n


1 4. a l l ow s yo u t o c r e a t e c u s to m b u t t on s .
( a) A n o p t i on d i al o g
( b ) A m e s s a ge d i al o g
( c ) A n i n p u t d i al o g
( d ) A c on fi r m a ti o n d i a l og

15. W h i ch o f th e f o l l ow i n g a r e s u b c l as s e s of j ava. aw t . C om p on e nt ?
( a) H e l p e r c l a s s e s s u ch a s C ol o r a n d Fo nt
( b ) L ayou t m an a ge r s
( c ) S w i n g u s e r i nt e r f a c e c l a s s e s
( d ) A l l U t i l i ty c l a s s e s

1 6. H ow m a ny f r am e s ar e d i s p l aye d ? i m p o r t j avax . s w i n g . * ; p u b l i c c l as s Te s t e xt e n d s J Fr a m e { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { J Fr a m e f 1 = ne w Te s t ( ) ; J Fr a m e f 2 = ne w Te s t ( ) ; J Fr a m e f 3 = ne w Te s t ( ) ; f 1 . s e t V i s i b l e ( t r u e ) ; f 2 . s e t V i s i b l e ( t r u e ) ; f 3 . s e t V i s i b l e ( t r u e ) ; } }
( a) 1 .
( b ) 0 .
( c ) 2 .
( d ) 3 .

1 7. To s p e c i f y a f ont t o b e b o l d a n d i t al i c , u s e t h e f o nt s tyl e va l u e
( a) Fo nt . I TA L I C
( b ) Fo nt . B O LD
( c ) Fo nt . P L A I N
( d ) Fo nt . B O LD + Fo nt . I TA L I C

1 8. G i ve n a G r ap h i c s ob j e c t g, to d r aw a n c i r c l e w i t h r ad i u s 2 0 c e nte re d a t ( 50 , 5 0) , yo u u s e
( a) g . d raw O val ( 5 0, 50 , 2 0 , 20 )
( b ) g . d raw O val ( 3 0, 30 , 2 0 , 2 0)
( c ) g . d raw O val ( 3 0, 30 , 4 0 , 40 )
( d ) g . d raw O val ( 5 0, 50 , 4 0 , 4 0)

1 9. A l i s te n e r o f a J L i s t mu s t im p l e m e nt .
( a) j ava x. s w i n g. e ve nt . A d j u s t m e nt L i s t e n e r
( b ) t h e j ava . aw t . A c t i o n L i s t e n e r i nt e r f ac e
( c ) j ava x. s w i n g. e ve nt . C h a n ge L i s t e n e r
( d ) t h e j ava . aw t . I t e m L i s t e n e r i nte rf ac e

2 0. T h e s e r ve r l i s t e n s f or a c on n e c t i on r e q u e s t f r om a c l i e nt u s i n g t h e f ol l ow i n g s t at e m e nt :
( a) S o cke t s = n e w S o cke t( S e r ve r N am e , p o rt ) ;
( b ) S o cke t s = s e r ve r S o cke t. g e t S o cke t ( )
( c ) S o cke t s = n e w S o cke t( S e r ve r N am e ) ;
( d ) S o cke t s = s e r ve r S o cke t. a c c e pt ( )

A A D D D A C D C A B C C A C D D C C D

JAVA ONLINE 3

1 . A n a l yz e t h e f ol l ow i n g c o d e : p u b l i c c l as s Te s t i m p l e m e nt s Ru n n a b l e { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] a r gs ) { T h r e a d t = n e w T h r e a d (t h i s ) ; t . s t ar t ( ) ; } p u b l i c vo i d r u n ( ) { S y s t e m . o u t. p r i nt l n (“ t e s t ” ); } }

( a) R u nt i m e E r ro r
( b ) T h e p ro g ra m d o e s n o t c om p i l e b e c au s e t h i s c an n o t b e re f e r e n c e d i n a s t a ti c m e t h o d .
( c ) T h e p ro g ra m c om p i l e s a nd r u n s fi n e an d d i s p l ay s te s t o n t h e c on s o l e .
( d ) T h e p ro g ra m c om p i l e s fi n e , b u t i t d o e s n o t p r i nt any t h i n g b e c a u s e t d o e s n o t i nvo ke t h e ru n ( ) m e t h o d .

2 . W h e n yo u r u n t h e f ol l ow i n g p r og r am , w h at w i l l h a p p e n ? p u b l i c c l as s Te s t e x t e n d s T h r e a d { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { Te s t t = n e w Te s t ( ); t . s t ar t ( ) ; t . s t ar t ( ) ; } p u b l i c vo i d r u n ( ) { S y s t e m . o u t. p r i nt l n (” t e s t ” ); } }
( a) N o th i n g i s d i s p l aye d .
( b ) A n i l l e g a l j ava .l a n g . I l l e g al T h r e ad S ta t e E xc e p ti o n m ay b e th r ow n b e c a u s e yo u j u s t s t ar t e d t h r e a d a n d t h re ad m i g ht have n o t ye t fi n i s h e d b e f o re you s t ar t i t a ga i n . ( c ) T h e p ro g ra m d i s p l ay s t e s t on c e . ( d ) T h e p r og ra m d i s p l ay s t e s t tw i c e .

3 . Which method on a condition should you invoke to causes the current thread to wait until the condition is signaled ?
( a) condition.wait( ) ; ( b ) condition.await (); ( c ) c o n d i t i on . wa i te d () ; ( d ) c o n d i t i on . wa i ti n g ( ) ;

4 . An instanceof describes the errors caused by your program and external circumstances . These errors can be caught and handled by your program .
( a) Runtime Exception ( b ) Error ( c ) Throwable ( d ) Exception

5 . W h a t i s d i s p l aye d o n t h e c on s o l e w h e n r u n n i n g t h e f o l l ow i n g p ro g ra m ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { t r y { m e t h o d ( ); S y s t e m . o u t. p r i nt l n (” A f t e r t h e m e t h o d c a l l ”) ; } c a t ch ( N u mb e r Fo rm a t E x c e p t i o n e x ) { S y s t e m . o u t. p r i nt l n (” N u mb e r Fo r m at E x c e p t i o n ”) ; } c a t ch ( Ru nt i m e E x c e p t i o n e x ) { S y s t e m . o u t. p r i nt l n (” R u nt i m e E xc e p ti o n ” ); } } s t a ti c voi d me th o d ( ) { S t r i n g s = “ 5. 6 ”; I nt e g e r . p ar s e I nt ( s ) ; / / C a u s e a N u mb e rFor m a t E x c e p t i o n i nt i = 0 ; i nt y = 2 / i ; S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } } (
a) T h e p r og ra m d i s p l ay s N u mb e rFor m a tE xc e p t i on f ol l owe d by A f t e r th e m e t h o d c a l l .
b) ( b ) T h e p r og ra m d i s p l ay s N u mb e rFor m a tE xc e p t i on f ol l owe d by R u nti m e E x c e p t i on .
c) ( c ) T h e p r og ra m d i s p l ay s N u mb e rFor m a tE xc e p t i on .
d) ( d ) T h e p r og ra m h a s a c om p i l a t i on e r ro r .


6 . W h a t i s d i s p l aye d o n t h e c on s o l e w h e n r u n n i n g t h e f ol l ow i n g p ro g ra m ? c l a s s Te s t { p u b l i c s t at i c vo i d m a i n (S t r i n g[ ] ar g s ) { t r y { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); i nt i = 0 ; i nt y = 2 /i ; S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } c a t ch ( Ru nt i m e E x c e p t i o n e x ) { S y s t e m . o u t. p r i nt l n (“ We l c om e t o J ava ” ); } fi n a l l y { S y s t e m . o u t. p r i nt l n (“ E n d of t he b l o ck ”) ; } } }
( a) T h e p r og ra m d i s p l ay s We l c o m e t o J ava two t i m e s .
( b ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava t h re e t i m e s f o ll owe d by E n d o f t h e b l o ck . ( c ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava t h re e t i m e s .
( d ) T h e p r og ra m d i s p l ay s We l c o m e t o J ava two t i m e s f o l l owe d by E n d o f t h e b l o ck .

7 . W h i ch o f th e f o l l ow i n g s t a t e m e nts r e g i s t e r s a p a n e l o b j e c t p a s a l i s t e n e r f o r a b u t t on va ri a b l e j b t?
( a) j b t . a d d A c t i on L i s t e n e r ( p ) ; ( b ) a d d A c t i on L i s t e n e r ( p ) ; ( c ) j b t . a d d E ve nt L i s t e n e r ( p ) ; ( d ) j b t . a d d A c t i on E ve nt Li s te n e r (p ) ;

8 . To l i s t e n t o m ou s e m ove m e nt e ve nt s , th e l i s t e n e r mu s t i m p l e m e nt t h e i nt e r f ac e .
( a) W i n d ow Li s te n e r () ( b ) M o u s e L i s t e n e r ( ) ( c ) C o m p o ne nt L i s t e n e r ( )
( d ) M o u s e M o t i on L i s t e n e r( )

9 . T h e ge tK e y C o d e () m e t h o d of t h e K e yE ve nt r e t u r n s .
( a) t h e E B S D I C c o d e o f t h e ch ar a c t e r ( b ) a ch a ra c t e r ( c ) t h e A S C I I c o d e o f t h e ch ar a c t e r ( d ) t h e U n i c o d e c o d e o f th e ch ar a c t e r

1 0. cannot be shared by a GUI component ?
( a) A C ol o r o b j e c t ( b ) A G U I c om p o n e nt ( c ) A l ayo u t o b j e c t ( d ) A Font o b j e c t

11. You can construct a JTabbed Pane using .
( a) n e w J Ta b b e d Pa n e ( C o m p on e nt ) ( b ) n e w J Ta b b e d Pa n e ( C o m p on e nt [ ] ) ( c ) n e w J Ta b b e d Pa n e ( C o m p on e nt , C om p o n e nt ) ( d ) n e w J Ta b b e d Pa n e ( )

1 2. Which of the following method will not create a LineBorder?
( a) n e w L i n e B o rd e r( C o l o r. Y E LL OW , 3 , t r u e ) ( b ) n e w L i n e B o rd e r( C o l o r. Y E LL OW , 3 ) ( c ) B o r d e r Fa c t or y. c r e a t e L i n e B o r d e r (C ol o r . Y E L LOW )
( d ) n e w L i n e B o rd e r( )

1 3. Which of the following statement is false ?
( a) Yo u c an ad d a J R a d i oB u tt o n M e nu I t e m to a J M e nu . ( b ) Yo u c an ad d a J M e nu I t e m t o a J M e nu . ( c ) You can add a JMenu to a JMenuItem . ( d ) Yo u c an ad d a J R a d i oB u tt o n M e nu I t e m to a J M e nu I te m .

1 4. W h i ch o f th e f o l l ow i n g s t a t e m e nts a re t r u e ?
( a) J B u t t o n h a s a n a d d m e t h o d t h at e n ab l e s you t o a d d a n i n s ta n c e of A c t i on t o th e m e nu . ( b ) J B u t t o n h a s a n a d d m e t h o d t h at e n ab l e s you t o a d d a n i n s ta n c e of A c t i on L i s t e n e r t o th e m e nu . ( c ) J To o l B a r h a s a n a d d m e t h o d t h a t e n a b l e s yo u t o ad d an i n s t an c e of A c t i o n Li s te n e r t o t h e m e nu .
( d ) JTool Bar has an add method that enables you to add an instanceof Action to the menu .

1 5. W h i ch o f th e f o l l ow i n g c l a s s e s a r e n o t i n t h e j ava. aw t p ackag e ? (
a) Fo nt ( b ) C o m p o ne nt ( c ) C o l or ( d ) J Fr a m e

1 6. T h e d e f a u l t l ayou t ou t o f a c ont e nt Pan e i n a J Fr a m e i s .
( a) B o r d e r L ayou t ( b ) G r i d B a g Layo u t ( c ) F l ow Layo u t ( d ) G r i d L ayou t

1 7. T h e m e t h o d s e t s t h e b a ckg r ou n d c o l or t o ye l l ow i n J Fra m e f .
( a) f . s e tB ack g r ou n d ( C o l or . Y E L L OW ) ( b ) f . s e tB ack G r o u n d ( C ol o r . ye l l ow ) ( c ) s e t B ack g ro u n d ( C ol o r . ye l l ow ) ( d ) s e t B ack g ro u n d ( C ol o r . Y E L L OW )

1 8. G i ve n a G r a p h i c s ob j e c t g, t o d r aw an o u tl i n e o f a r e c t an g l e of w i d t h 20 an d h e i g ht 50 w i t h t h e u p p e r - l e f t c o r n e r a t ( 20 , 2 0) , yo u u s e
( a) g . d raw R e c t (2 0 , 2 0, 20 , 5 0) ( b ) g . d raw R e c t F i l l (2 0 , 5 0, 20 , 2 0) ( c ) g . d raw R e c t F i l l (2 0 , 2 0, 20 , 5 0) ( d ) g . d raw R e c t (2 0 , 5 0, 20 , 2 0)

1 9. J S p i n n e r fi r e s w h e n a n e w val u e i s s e l e c t e d .
( a) j ava x. s w i n g. e ve nt . C h a n ge E ve nt ( b ) j ava . aw t . A c t i on E ve nt ( c ) j ava . aw t . e ve nt. I te m E ve nt ( d ) j ava x. s w i n g. e ve nt . A d j u s t m e nt E ve nt

2 0. T h e m e t h o d i n t h e I n e t A d d r e s s c l a s s r e t u r n s th e I P ad d r e s s .
( a) g e t A d d re s s ( ) ( b ) g e t I PA d d r e s s ( ) ( c ) g e t I P ( ) ( d ) g e t H os t A d d r e s s ()


BBBDC DADDB DDCDD AAAAD

About Me