• Post Reply Bookmark Topic Watch Topic
  • New Topic

exam qs- modifiers and identifiers-help  RSS feed

sarim raza
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please explain,thanks!
1.valid identifiers ?
^ ^
D]angstrom // seems like some foreign language letters

2.Which modifiers and return types would be valid in the declaration of a working main() method for a Java standalone application?

3.Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?
public class Qf575 {
// insert declaration of a native method here
A]native public void setT(int kelvin)
B]private native void setT(int K)
C]protected int native getT();
D]public abstract native void setT(int k)
E]native int setT(int k)

4. Which statements concerning the value of a member variable are true, when no explicit assignments have been made?
A]Value of int is undetermined
B]Value of all numeric types is zero
C]Compiler may issue an error if the variable is used before it is iitialized
D]Value of a string variable is "" emty string
E]Value of all object variables is null
5. which of the following are true for a switch statement?
A]all switch statements must have a default label
B]there must be atleast one label for each code segment
C]keyword continue can never occur
D]no case label may follow a default label
E]char literal can be used

Oliver Grass
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sarim,
don't get me wrong, but if you try and compile these questions, you will get a lot of answers. For example the questions about the valid identifiers.
Believe me, if you hack this stuff and try it, you will have a greater benefit than just posting these questions and reading the answers...
One more thing. If you really have difficultiest with some questions, be sure, that you post them right. For example question 2, none of these are valid, cause they all start with uppercase letters (i doubt that in the question they started with uppercase letter, rite )
I will have a look at the more complex ones, so be patient, on some of these questions you will get an answer (of course only if i know the solution )
[This message has been edited by Oliver Grass (edited November 10, 2000).]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!