Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 03-04-06, 02:14 PM   #1 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,419
Thanks: 0
Thanked 18 Times in 13 Posts
Thanks: 0
Thanked 18 Times in 13 Posts
Rep Power: 19 keerthi has disabled reputation


Find the o/p of the following


Q. 1


Which of the following return true?
  1. "john" == "john"
  2. "john".equals("john")
  3. "john" = "john"
  4. "john".equals(new Button("john"))


Select all correct answers.





Q. 2


Which of the following do not lead to a runtime error?
  1. "john" + " was " + " here"
  2. "john" + 3
  3. 3 + 5
  4. 5 + 5.5


Select all correct answers.





Q. 3


Which of the following are so called "short circuit" logical operators?
  1. &
  2. ||
  3. &&
  4. |


Select all correct answers.





Q. 4


Which of the following are acceptable?
  1. Object o = new Button("A");
  2. Boolean flag = true;
  3. Panel p = new Frame();
  4. Frame f = new Panel();
  5. Panel p = new Applet();


Select all correct answers.





Q. 5


What is the result of compiling and running the following code:





public class Test {


static int total = 10;


public static void main (String args []) {


new Test();


}


public Test () {


System.out.println("In test");


System.out.println(this);


int temp = this.total;


if (temp > 5) {


System.out.println(temp);


}


}


}


  1. The class will not compile
  2. The compiler reports and error at line 2
  3. The compiler reports an error at line 9
  4. The value 10 is one of the elements printed to the standard output
  5. The class compiles but generates a runtime error





Select all correct answers.





Q 6


Which of the following is correct:
  1. String temp [] = new String {"j" "a" "z"};
  2. String temp [] = { "j " " b" "c"};
  3. String temp = {"a", "b", "c"};
  4. String temp [] = {"a", "b", "c"};


Select the most appropriate answer.


Answers
13. A, B
14. A, B, C, D
15.B, C
16. A, E
17. D
18. D
19. A





Edited by: keerthi
__________________
\"Winners don\'t do different things.They do things Differently\"
keerthi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 12:46 AM   #2 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello




Q 6



Which of the following is correct:
  1. String temp [] = new String {"j" "a" "z"};
  2. String temp [] = { "j " " b" "c"};
  3. String temp = {"a", "b", "c"};
  4. String temp [] = {"a", "b", "c"};



Select the most appropriate answer.
thiss is the way of representing the string array !


__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 01:32 AM   #3 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello





Q. 5




What is the result of compiling and running the following code:









public class Test

{




static int total = 10;




public static void main (String args [])

{




new Test();




}




public Test ()

{




System.out.println("In test");




System.out.println(this);




int temp = this.total;




if (temp > 5) {




System.out.println(temp);




}




}




}




The class will not compile

  1. The compiler reports and error at line 2
  2. The compiler reports an error at line 9
  3. The value 10 is one of the elements printed to the standard output
  4. The class compiles but generates a runtime error

__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 01:33 AM   #4 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello





hello









Q. 4





Which of the following are acceptable?


  1. Object o = new Button("A");
  2. Boolean flag = true;
  3. Panel p = new Frame();
  4. Frame f = new Panel();
  5. Panel p = new Applet();



__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 01:36 AM   #5 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello


Q. 3



Which of the following are so called "short circuit" logical operators?
  1. &
  2. ||
  3. &&
  4. |



Select all correct answers.




Logical AND n OR are called short circiut operators





__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 01:37 AM   #6 (permalink)
Junior Member
 
Join Date: Apr 2006
Location: India
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 kamlakerkarra has disabled reputation


Q1. 2


Q2. 1,2,3


Q3. 1,4


Q4. 1,2,4


Q5. 4


Q6. 4


__________________
kamalakerreddy
kamlakerkarra is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 01:44 AM   #7 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello





Q. 2




Which of the following do not lead to a runtime error?

  1. "john" + " was " + " here"
  2. "john" + 3
  3. 3 + 5
  4. 5 + 5.5




Select all correct answers.




Yes all r working fine!







__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 01:49 AM   #8 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation


Q. 1





Which of the following return true?


  1. "john" == "john"
  2. "john".equals("john")
  3. "john" = "john"
  4. "john".equals(new Button("john"))



Select all correct answers






__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 02:04 AM   #9 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello all



sory my above answer is wrong so ehrz my correct answer



Q. 5



What is the result of compiling and running the following code:







public class Test {



static int total = 10;



public static void main (String args []) {



new Test();



}



public Test () {



System.out.println("In test");



System.out.println(this);



int temp = this.total;



if (temp > 5) {



System.out.println(temp);



}



}



}




  1. The class will not compile
  2. The compiler reports and error at line 2
  3. The compiler reports an error at line 9
  4. The value 10 is one of the elements printed to the standard output
  5. The class compiles but generates a runtime error




There is no problem with the code the class compiles successfully and gives the output as



In Test



10 as the answer




__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-04-06, 03:06 PM   #10 (permalink)
Member
 
Join Date: Mar 2006
Location: India
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 amitshresth has disabled reputation


hello,


keerthi sir,


as you privide answers of asked questions has no serial no.as questions are and more then the questions asked.it has done by knowingly or some reason.and no explanation of answers.


as given below:


Find the o/p of the following


Q. 1


Which of the following return true?
  1. "john" == "john"
  2. "john".equals("john")
  3. "john" = "john"
  4. "john".equals(new Button("john"))


Select all correct answers.





Q. 2


Which of the following do not lead to a runtime error?
  1. "john" + " was " + " here"
  2. "john" + 3
  3. 3 + 5
  4. 5 + 5.5


Select all correct answers.





Q. 3


Which of the following are so called "short circuit" logical operators?
  1. &
  2. ||
  3. &&
  4. |


Select all correct answers.





Q. 4


Which of the following are acceptable?
  1. Object o = new Button("A");
  2. Boolean flag = true;
  3. Panel p = new Frame();
  4. Frame f = new Panel();
  5. Panel p = new Applet();


Select all correct answers.





Q. 5


What is the result of compiling and running the following code:





public class Test {


static int total = 10;


public static void main (String args []) {


new Test();


}


public Test () {


System.out.println("In test");


System.out.println(this);


int temp = this.total;


if (temp > 5) {


System.out.println(temp);


}


}


}


  1. The class will not compile
  2. The compiler reports and error at line 2
  3. The compiler reports an error at line 9
  4. The value 10 is one of the elements printed to the standard output
  5. The class compiles but generates a runtime error





Select all correct answers.





Q 6


Which of the following is correct:
  1. String temp [] = new String {"j" "a" "z"};
  2. String temp [] = { "j " " b" "c"};
  3. String temp = {"a", "b", "c"};
  4. String temp [] = {"a", "b", "c"};


Select the most appropriate answer.


Answers
13. A, B
14. A, B, C, D
15.B, C
16. A, E
17. D
18. D
19. A
__________________
_________________
sky is the limit
With Regards...!
amit kulshreshtha
amitshresth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +6.5. The time now is 02:51 PM.





Search Engine Optimization by vBSEO 3.1.0