25 question "java"
The name of a Java program file must match the name of the class with the extension .java
- True
B. False
Two methods cannot have the same name in Java.
A. True
- False
The modulus operator (%) can be used only with integer operands
- True
- False
Declarations can appear anywhere in the body of a Java method.
- True
- False
All the bitwise operators have the same level of precedence in Java.
- True
- False
When X is a positive number, the operations x>>2 and x>>>2 both produce the same result.
- True
B. False
If a=10 and b=15, then the statement x=(a>b)?a:b; assigns the value 15 to x
- True
B. False
In evaluating a logical expression of type
Boolean expression1 && Boolean expression2
Both the Boolean expressions are not always evaluated.
- True
B. False
In evaluating the expression (x == y && a<b) the boolean expression x==y is evaluated first and then a<b is evaluated.
- True
B. False
The default base is always required in the switch selection structure.
- True
B. False
The break statement is required in the default case of a switch selection structure.
- True
B. False
The expression (x ==y && a<b) is true if either x == y is true or a<b is true
- True
B. False
A variable declared inside the for loop control cannot be referenced outside the loop
- True
B. False
Java always provides a default constructor to a class
- True
B. False
When present package must be the first noncomment statement in the file.
- True
B. False
The import statement is always the first noncomment statement in a Java program file
- True
B. False
Objects are passed to a method by use of call-by-reference
- True
B. False
It is perfectly legal to refer to any instance variable inside of a static method.
- True
B. False
When we implement an interface method, it should be declared as public
- True
B. False (abstract)
We can overload methods with differences only in their return type
- True
B. False
It is an error to have a method with the same signature in both the super class and its subclass.
- True
B. False
A constructor must always invoke its super class constructor in its first statement.
- True
B. False
Subclasses of an abstract class that do not provide an implementation of an abstract method, are also abstract.
- True
B. False
Any class may be inherited by another class in the same package.
- True
B. False
Any method in a super class can be overridden in its subclass.
- True
B. False
All Replies
- This is J# forum, most of your questions are native java. It will be nice if you can ask the question at native java forum http://forums.sun.com/index.jspa.
kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on- Proposed As Answer bypoonam thind Sunday, October 18, 2009 11:53 AM
- motto tainu answers chahide c tan mainu dasdi. net te pange lain di lod ki c puttar.
- Answers only for u Dear Motto
1. F 14. T
2. F 15. T
3. F 16. F
4. T 17. T
5. F 18. T
6. F 19. T
7. T 20. F
8. F 21. T
9. T 22. T
10. T 23. T
11. T 24. F
12. F 25. F
13. T
- ok mai dekhta hu.
what is the meaning of motto.


