This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

A suggestion for list of Mock Questions

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a small suggestion.I have observed in this list that
a same set of Tricky Questions from various Mock Exams Crop
up again and again.Shall we make a list in this thread
of all the Tricky Questions/Questions related to fundamentals
we find,without repeating any of them so that we have a consolidated list of Questions Also, We should put only the hardest questions and their answers.Also if we have to discuss about any of the questions in this list ,we should do it in a different Thread ,so That this thread does not get Cluttered.
To start The Thread I add a question I felt tested your fundamentals

Q 1)
class ApBase extends Object implements Runnable.
1. Apbase aBase = new ApBase();
2. Runnable aR = aBase;
3. Object obj = aR;
4. Apbase x = (Apbase)obj;
What will happen when we try to compile and run?
a. Compiler objects to line 2.
b. Compiler objects to line 3.
c.Code compiles but when run , throws ClassCastException in line 4.
d. Compiles and runs fine.
Answer --> D

Another Question
Q2
Which of the options below will print
running on the Command Line
1. class RunTest implements Runnable {
2. public static void main(String args[]) {
3. RunTest rt = new RunTest();
4. Thread t = new Thread(rt);
5. //A
6. }
7. public void run() {
8. System.out.println("running");
9. }
10. void go() {
11. start(1);
12. }
13. void start(int i) {
14. }
15. }
Select all valid answers.
a. System.out.println("running");
b. rt.start();
c. rt.go();
d. rt.start(1);
Ans--> a
[This message has been edited by Prasanna Joshi (edited June 30, 2000).]
[This message has been edited by Prasanna Joshi (edited June 30, 2000).]
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good idea for a topic, but you need to put the name and location of the mock exam(s) in your post in order to keep in the spirit of JavaRanch. Thanks!
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice thought, but for the subjective term "tricky". How does one ascertain whether the question is 'tricky' enough to be posted here(in this thread) or not. It may be tricky for me but for Satya, it may not be...may be for Ajith...but may not be for Paul....so.....if only some moderator intervenes regularly for cleaning up the thread...for fine tuning it....
..sorry for pouring cold water !
--Shiny
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic