.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Newgen Placement Papers » Newgen Previous Year Placement Paper

 

Newgen Placement Paper -: Java Questions With Answers


Advertisements
Advertisements




Newgen Previous Years Solved Sample Placement Papers

  1. What is the output of the following program?
        public class Question {
        public static void main(String args[]) {
            String s1 = "abc";
            String s2 = "def";
            String s3 = s1.concat(s2.toUpperCase());
            System.out.println(s1 + s2 + s3);
        }
        }
        
    a) abcdefabcdef b) abcabcDEFDEF c) abcdefabcDEF d) None of the above Answer: c) abcdefabcDEF Explanation: The string s3 is formed by concatenating s1 and the uppercase of s2, resulting in "abc" + "def" + "DEF", so the output is "abcdefabcDEF".
  2. Which of the following methods are methods of the String class? a) delete( ) b) append( ) c) reverse( ) d) replace( ) Answer: d) replace( ) Explanation: The replace() method is part of the String class, while the others are not.
  3. Which of the following methods cause the String object referenced by s to be changed? a) s.concat( ) b) s.toUpperCase( ) c) s.replace( ) d) s.valueOf( ) Answer: a) and b) Explanation: concat() and toUpperCase() return new strings; however, they modify the string indirectly since strings in Java are immutable.
  4. Is String a wrapper class? a) True b) False Answer: b) False Explanation: String is not a wrapper class. Wrapper classes in Java are used to wrap primitive types, but String is used to represent sequences of characters.
  5. What is an Applet? Should applets have constructors? Answer: Applet is a dynamic and interactive program that runs inside a Web page displayed by a Java-capable browser. We don’t have the concept of Constructors in Applets.
  6. How can I arrange for different applets on a web page to communicate with each other? Answer: Name your applets inside the Applet tag and invoke AppletContext’s getApplet() method in your applet code to obtain references to the other applets on the page.
  7. How do I select a URL from my Applet and send the browser to that page? Answer: Ask the applet for its applet context and invoke showDocument() on that context object.
        Example:
        URL targetURL;
        String URLString;
        AppletContext context = getAppletContext();
        try {
            targetURL = new URL(URLString);
        } catch (MalformedURLException e) {
            // Code for recovery from the exception
        }
        context.showDocument(targetURL);
        
  8. Can applets on different pages communicate with each other? Answer: No. Not directly. The applets will exchange the information at one meeting place, either on the local file system or at a remote system.
  9. How do Applets differ from Applications? Answer:
    • Appln: Stand Alone
    • Applet: Needs no explicit installation on the local machine
    • Appln: Execution starts with the main() method
    • Applet: Execution starts with the init() method
    • Appln: May or may not have a GUI
    • Applet: Must run within a GUI (Using AWT)
  10. What are the Applet’s Life Cycle methods? Explain them? Answer: init() method - Called when an applet is first loaded. Applets have a defined life cycle including the init(), start(), stop(), and destroy() methods.




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy