.
  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. Which of the following is true about servlets?
        a) Servlets can use the full functionality of the Java class libraries
        b) Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
        c) Servlets execute within the address space of web server
        d) Servlets are platform-independent because they are written in java
        
    Answer: b) Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries Explanation: Servlets execute within the address space of a web server. Since they are written in Java, they are platform-independent, and the full functionality of Java class libraries is available.
  2. When do exceptions in Java arise in the code sequence?
        a) Run Time
        b) Compilation Time
        c) Can Occur Any Time
        d) None of the mentioned
        
    Answer: a) Run Time Explanation: Exceptions in Java are run-time errors that occur when the program is executing.
  3. Which of these keywords is not a part of exception handling?
        a) try
        b) finally
        c) thrown
        d) catch
        
    Answer: c) thrown Explanation: The five main keywords for exception handling are: try, catch, throws, throw, and finally.
  4. Which of these keywords must be used to monitor for exceptions?
        a) try
        b) finally
        c) throw
        d) catch
        
    Answer: a) try Explanation: The try block is used to monitor for exceptions in Java.
  5. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?
        a) try
        b) finally
        c) throw
        d) catch
        
    Answer: d) catch Explanation: If an exception occurs in the try block, it is handled by the catch block.
  6. Which of these keywords is used to manually throw an exception?
        a) try
        b) finally
        c) throw
        d) catch
        
    Answer: c) throw Explanation: The throw keyword is used to manually throw an exception in Java.
  7. What will be the output of the following Java program?
        class exception_handling 
        {
            public static void main(String args[]) 
            {
                try 
                {
                    System.out.print("Hello" + " " + 1 / 0);
                }
                catch(ArithmeticException e) 
                {
                    System.out.print("World");
                }
            }
        }
        
    Answer: b) World Explanation: The 1 / 0 causes an ArithmeticException, which is caught by the catch block, printing "World". Output:
        $ javac exception_handling.java
        $ java exception_handling
        World
        




 


.

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