JAVA QUESTIONS HELP!!!!!
Hi there im a student and have an exam on java coming up next week, i have a few past paper questions that im stuck with if anyone can help that would be great.....
1.) Java implements generic types by erasure: what does this mean?
A. The compiler removes references to parameter types and inserts casts wherever return types refer to parameter types.
B. The programmer must comment out references to parameter types before code is compiled.
C. The compiler removes any casts that may be type-unsafe.
D. The compiler removes any references to parameter types and inserts references to the closest super class that will make expressions type-safe.
E. Any type-unsafe casts to parameter types will be ignored by the interpreter at run-time.
2.) In Remote method Invocation, what is meant by 憁arshalling?
A. Marshalling is the process of synchronizing all parameters to the method being invoked, in order to
prevent data corruption arising from the concurrent method call.
B. Marshalling is the process of sending a copy of the remote object to the client JVM in order to
invoke its method locally.
C. Marshalling is the process of sending the state of the client JVM on a byte stream to the remote
object in order that the JVM can be started as a separate thread on the remote host.
D. Marshalling is the process of suspending the current thread in the client JVM until a result is obtained
from the remote method invocation.
E. Marshalling is the process of sending the state of all parameter instances on a byte stream to the remote object.
3.)What is the immediate superclass of javax.swing.JFrame?
A. java.lang.Object
B. javax.swing.Window
C. javax.swing.JComponent
D. java.AWT.Window
E. java.AWT.Frame
4.) What is the immediate superclass of javax.swing.JComponent?
A. java.lang.Object
B. java.AWT.Component
C. java.AWT.Container
D. java.AWT.Window
E. javax.swing.Object
5.) Which of the following statements about the java.AWT and javax.swing packages is true?
A. All components in both packages are thread-safe
B. Most components in both packages are thread-safe
C. Most components in java.AWT are thread-safe, but most in javax.swing are not
D. Most components in javax.swing are thread-safe, but most in java.AWT are not
E. No components in either package are thread-safe
6.) Which of the following best describes how AWT events are handled in Java?
A. There is a special thread that handles all AWT events.
B. Each AWT event causes a new thread to be created to handle that event.
C. All AWT events are handled in the main thread.
D. The programmer must explicitly create one thread to handle all AWT events.
E. For each AWT event, the programmer must explicitly create a thread to handle that event.
7.) Which of the following best describes how component-generated events can be handled in Java?
A. All component-generated events are handled automatically by the Java interpreter.
B. The programmer creates instances of appropriate listener classes, and registers these instances with
the component; when the component generates an event, the relevant methods of all registered
listeners are executed.
C. The programmer creates instances of appropriate listener classes, and registers these instances with
the component; when the component generates an event, one of the registered listeners is chosen by
the interpreter and the relevant method of that instance is executed.
D. The programmer must declare a subclass of the component and add one method for each type of
event the component can generate; when the component generates an event, the appropriate method
is executed.
E. Each component class has event-handling methods; the programmer declares a subclass of the
component and overrides those methods; when the component generates an event, the overridden
method is executed.
Any help would b great thanks guys. Andy
> Hi there im a student and have an exam on java coming
> up next week, i have a few past paper questions that
> im stuck with if anyone can help that would be
> great.....
Did you consider asking your peers or look at your study notes?
> 1.) Java implements generic types by erasure: what
> does this mean?
http://www.google.com/search?q=java+generic+type+erasure
> 2.) In Remote method Invocation, what is meant by
> 憁arshalling?
http://www.google.com/search?q=rmi+marshalling
> 3.)What is the immediate superclass of
> javax.swing.JFrame?
http://www.google.com/search?q=jframe
> 4.) What is the immediate superclass of
> javax.swing.JComponent?
http://www.google.com/search?q=jcomponent
And so forth. Stop wasting our time pelase.
The lecturers dont give you any help!!! i think they may repeat some of the questions in the exam see, so there are no solutions!
so in this example....Class JComponentjava.lang.Object extended byjava.awt.Componentextended byjava.awt.Container extended byjavax.swing.JComponentWhat would be the immediate superclass of JComponent, Container or object?
> The lecturers dont give you any help!!!
So what part of "check your lecture notes or ask your peers" didn't you understand? First, if those things are asked, they were probably taught to you or it was your task to teach yourself. Second, you're probably not the only student in your class, so go ask your mates if you don't understand something. Third, if you don't want to do that, do the very little research required for those answers yourself.
> would be the immediate superclass of> JComponent, Container or object?Which one would you think? Which class does it directly extend?
what u on about, u no nothin about my course, the lecture notes are ****, they dont tell you anythin, and i dont have any firends on my course, i keep myself to myself, and them questions theres like 2 possible answers it coud be, i just asked a quesiton mate, no need to be funny, if im wastin ur time why did u even answer
> what u on about, u no nothin about my course, the
> lecture notes are ****, they dont tell you anythin,
What about the notes you took yourself during the lectures? At least here, a significant part of studying is to learn not to rely on others to give you information.
> and i dont have any firends on my course, i keep
> myself to myself,
If that's true, you wouldn't have posted here. I'm sorry, but software development is, despite of the stereotype, nothing for someone who doesn't liek to talk to others. You'll always remain a replaceable code monkey at best.
> and them questions theres like 2
> possible answers it coud be, i just asked a quesiton
> mate, no need to be funny, if im wastin ur time why
> did u even answer
Because, believe it or not, I do not assume that you're a brainless imbecile. I do assume that you have at least a bit of intelligence, and so I expect you to use it by e.g. doing some research. And if you learn to do that, you might a) actually become a useful developer and b) stop asking questions like those here, which means less effort for me in the long run. That's why I reply. It's called "education".
> 1.) Java implements generic types by erasure: what
> does this mean?
> A. The compiler removes references to parameter types
> and inserts casts wherever return types refer to
> parameter types.
> B. The programmer must comment out references to
> parameter types before code is compiled.
> C. The compiler removes any casts that may be
> type-unsafe.
> D. The compiler removes any references to parameter
> types and inserts references to the closest super
> class that will make expressions type-safe.
> E. Any type-unsafe casts to parameter types will be
> ignored by the interpreter at run-time.
None of the above (assuming this is not a Google translation of some non-English text).
> 2.) In Remote method Invocation, what is meant by
> 憁arshalling?
> A. Marshalling is the process of synchronizing all
> parameters to the method being invoked, in order to
> prevent data corruption arising from the concurrent
> method call.
> B. Marshalling is the process of sending a copy of
> the remote object to the client JVM in order to
> invoke its method locally.
> C. Marshalling is the process of sending the state of
> the client JVM on a byte stream to the remote
> object in order that the JVM can be started as a
> separate thread on the remote host.
> D. Marshalling is the process of suspending the
> current thread in the client JVM until a result is
> obtained
> from the remote method invocation.
> E. Marshalling is the process of sending the state of
> all parameter instances on a byte stream to the
> remote object.
None of the above. Although there is one answer that at least describes how Marshalling is used.
> 3.)What is the immediate superclass of
> javax.swing.JFrame?
> A. java.lang.Object
> B. javax.swing.Window
> C. javax.swing.JComponent
> D. java.AWT.Window
> E. java.AWT.Frame
At least this one does have the correct answer. It's in the API docs, so I guess it'd be hard to be wrong.
> 4.) What is the immediate superclass of
Ditto.
> 5.) Which of the following statements about the
> java.AWT and javax.swing packages is true?
> A. All components in both packages are
> thread-safe
> B. Most components in both packages are
> thread-safe
> C. Most components in java.AWT are thread-safe, but
> most in javax.swing are not
> D. Most components in javax.swing are thread-safe,
> but most in java.AWT are not
> E. No components in either package are
> thread-safe
Again, none of the above.
> 6.) Which of the following best describes how AWT
> events are handled in Java?
> A. There is a special thread that handles all AWT
> events.
> B. Each AWT event causes a new thread to be created
> to handle that event.
> C. All AWT events are handled in the main thread.
>
> D. The programmer must explicitly create one thread
> to handle all AWT events.
> E. For each AWT event, the programmer must explicitly
> create a thread to handle that event.
One answer is almost, sort of, correct. Wow.
I can understand why you're having problems answering these questiosn. Well, there's no excuse for the questions that come out fo the Javadocs, but for the others ... it explains a lot about the quality of recent graduates.
> I can understand why you're having problems answering
> these questiosn. Well, there's no excuse for the
> questions that come out fo the Javadocs, but for the
> others ... it explains a lot about the quality of
> recent graduates.
If he actually tried to find an answer, personally I would expected a question like: "I can't find the correct answer for this - X, Y and Z are wrong because of ..., and I think even U and V can't really be correct because...", showing that the OP worked on it at least a little.
Simply dumping the questions here doesn't send this signal at all though.
to be fair mate, im not even interested in programming or developing and i certainly wont be doing that when i leave university because im not a geek like you. I did it primarily to get a degree, it shows you can work at a certtain level, i may become a housing agent when i grow up, but my main ambition is to continue in being a professional recording artsit which i am doin semi professionally at the moment, but you enjoy sitting infront of a computer all day doing boring programming. much love x x
Wow, way to get some answers from them boring geeks.Go read: http://catb.org/~esr/faqs/smart-questions.html
mlka at 2007-7-8 8:54:09 >

> but you enjoy sitting infront of a computer
> all day doing boring programming. much love x x
Actually, I don't particularly enjoy programming. But it's a decent salary, which beats that of most professional recording artists (yeah, kid, there aren't a lot of people who get lucky and become millionaires).
And I'm sure it beats what you make waiting tables as a "semi professional" recording "artist."
> to be fair mate, im not even interested in
> programming or developing and i certainly wont be
> doing that when i leave university because im not a
> geek like you.
I must appologise for my colleagues. The vast majority of them do not know how to tailor their communication. Perhaps I can assist.
OI U FU CKIN UNI WANNABE AR SEHOLE! I BET U R 1 OF
THESE FU CKIN BUSINESS TWATS HU HANG ARUND THE 'PUTER LAB AL TH
TYM LOOKIN' FO OTHERS TO DO UR WERK, WELL FUCKIN DO EVRY1 A FAVA ND SET YASEL AWAY!
we are hear to help you how you can answer your own question before coming and asking question here, every thing is discussed in google, go search there, if you dont find anything and drop your question with your findings (if zero say zero finding). Then we can do our best
I wasnt being offensive but i just got loads of stick for some reason. It was the french guy i had a problem with no one else, not captain fantastic or whatever, an althought you sed your prob earning more money than me i doubt you are as i am in one of the uk's top beatles tribute bands and touring theatres around the UK and europe but no probs, enjoy your salary programming, im happy for you. cya later yeah x x
hi there i was wondering whether you could help me with a few of the following queations; thanks a lot:
1.) Which of the following is true for an applet downloaded from a remote HTTP server?
A. The applet can read and write to files on the native file system.
B. The applet can only read files on the native file system, but cannot write to them.
C. The applet can open network connections to any HTTP server.
D. The applet can only open network connections to the HTTP server from which it was downloaded.
E. The applet can execute processes in the native operating system.
2.) Suppose you are writing a parser for a programming language as part of a window-based program
editor and compiler. You might decide to use a class ParseException to handle the case where the
input program is not syntactically well-formed. Colleagues propose the following courses of action:
1. ParseException should extend Exception so that instances can be thrown with the keyword
throw;
2. ParseException should extend RuntimeException because instances would only be
thrown at run-time;
3. ParseException should extend RuntimeException so that methods do not need to advertise
that they might throw ParseException;
4. all methods should advertise rather than catch ParseException so that syntactic errors can be
reported by the top-level program editor.
Which of these suggestions should you follow?
A. 4 only.
B. 1 and 4 only.
C. 2 and 3 only.
D. 1, 3 and 4 only.
E. 2, 3 and 4 only.
21. Below are some subclasses of java.awt.AWTEvent:
1. KeyEvent
2. TextEvent
3. MouseEvent
4. ActionEvent
Which of these can be handled by a listener registered with a TextField component?
A. 1 and 2 only.
B. 2 and 3 only.
C. 1, 2 and 4 only.
D. 2, 3 and 4 only
E. All of them.
chers mate x
> hi there i was wondering whether you could help me
> with a few of the following queations; thanks a lot:
>
> 1.) Which of the following is true for an applet
> downloaded from a remote HTTP server?
> A. The applet can read and write to files on the
> native file system.
> B. The applet can only read files on the native file
> system, but cannot write to them.
> C. The applet can open network connections to any
> HTTP server.
> D. The applet can only open network connections to
> the HTTP server from which it was
> downloaded.
> E. The applet can execute processes in the native
> operating system.
Which do you think and why?
>
>
> 2.) Suppose you are writing a parser for a
> programming language as part of a window-based
> program
> editor and compiler. You might decide to use a class
> ParseException to handle the case where the
> input program is not syntactically well-formed.
> Colleagues propose the following courses of action:
> 1. ParseException should extend Exception so that
> instances can be thrown with the keyword
> throw;
> 2. ParseException should extend RuntimeException
> because instances would only be
> thrown at run-time;
> 3. ParseException should extend RuntimeException so
> that methods do not need to advertise
> that they might throw ParseException;
> 4. all methods should advertise rather than catch
> ParseException so that syntactic errors can be
> reported by the top-level program editor.
> Which of these suggestions should you follow?
> A. 4 only.
> B. 1 and 4 only.
> C. 2 and 3 only.
> D. 1, 3 and 4 only.
> E. 2, 3 and 4 only.
>
>
Which do you think and why?
> 21. Below are some subclasses of java.awt.AWTEvent:
> 1. KeyEvent
> 2. TextEvent
> 3. MouseEvent
> 4. ActionEvent
> Which of these can be handled by a listener
> registered with a TextField component?
> A. 1 and 2 only.
> B. 2 and 3 only.
> C. 1, 2 and 4 only.
> D. 2, 3 and 4 only
> E. All of them.
>
Which do you think and why?
> > ND SET YASEL AWAY!Ah Yasel. How is he doing? Long time no see.
> hi there i was wondering whether you could help me
> with a few of the following queations; thanks a lot:
>
> 1.) Which of the following is true for an applet
> downloaded from a remote HTTP server?
> A. The applet can read and write to files on the
> native file system.
> B. The applet can only read files on the native file
> system, but cannot write to them.
> C. The applet can open network connections to any
> HTTP server.
> D. The applet can only open network connections to
> the HTTP server from which it was
> downloaded.
> E. The applet can execute processes in the native
> operating system.
>
Which do you think it is and why ?
>
> 2.) Suppose you are writing a parser for a
> programming language as part of a window-based
> program
> editor and compiler. You might decide to use a class
> ParseException to handle the case where the
> input program is not syntactically well-formed.
> Colleagues propose the following courses of action:
> 1. ParseException should extend Exception so that
> instances can be thrown with the keyword
> throw;
> 2. ParseException should extend RuntimeException
> because instances would only be
> thrown at run-time;
> 3. ParseException should extend RuntimeException so
> that methods do not need to advertise
> that they might throw ParseException;
> 4. all methods should advertise rather than catch
> ParseException so that syntactic errors can be
> reported by the top-level program editor.
> Which of these suggestions should you follow?
> A. 4 only.
> B. 1 and 4 only.
> C. 2 and 3 only.
> D. 1, 3 and 4 only.
> E. 2, 3 and 4 only.
Which do you think it is and why ?
>
> 21. Below are some subclasses of java.awt.AWTEvent:
> 1. KeyEvent
> 2. TextEvent
> 3. MouseEvent
> 4. ActionEvent
> Which of these can be handled by a listener
> registered with a TextField component?
> A. 1 and 2 only.
> B. 2 and 3 only.
> C. 1, 2 and 4 only.
> D. 2, 3 and 4 only
> E. All of them.
Which do you think it is and why ?
>
> chers mate x
Cheers
*Edit* Infernal cotton being that wee bit faster than me.
