Java: Interview Questions and Answers

Q: What do you know about Java?
A: Java is a high-level programming language originally developed by Sun Microsystems and released in 1995.
Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

Q: What are the supported platforms by Java Programming Language?
A: Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX/Linux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc.

Q: List two Java IDE’s?
A: Netbeans, Eclipse, etc.

Q: List some Java keywords(unlike C, C++ keywords)?
A: Some Java keywords are import, super, finally, etc.

Q: What do you mean by Object?
A: Object is a runtime entity and it’s state is stored in fields and behavior is shown via methods.
 Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication.

Q: What do you mean by Constructor?
A: Constructor gets invoked when a new object is created. Every class has a constructor.
 If we do not explicitly write a constructor for a class the java compiler builds a default constructor for that class.

Q: What is the default value of float and double datatype in Java?
A: Default value of float and double datatype in different as compared to C/C++. For float its 0.0f and for double it’s 0.0d
Q: How finally used under Exception Handling?
A: The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred.

Q: What is Encapsulation?
A: It is the technique of making the fields in a class private and providing access to the fields via public methods.
 If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class.
Therefore encapsulation is also referred to as data hiding.

Q: What is the purpose of garbage collection in Java, and when is it used?
A: The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused.

A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.

Q: What if the static modifier is removed from the signature of the main() method?

A: Program compiles. But at runtime throws an error "NoSuchMethodError".

Q:  What if I write static public void instead of public static void?

A: Program compiles and runs properly.

Q:. What is the difference between an Interface and an Abstract class?

A: An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract.

An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.

What to do after BCA?

There are numerous options available for students who have finished their BCA. They can either go for MCA or find a good job. Job opportunities are not restricted within India, as candidates will be able to get lucrative jobs abroad.

Apart from this, it can be said that the BCA degree is in demand with both the public as well as private sectors. Details on what to do after graduating in BCA are explained below.

Higher Studies Options after BCA

Masters in Computer Management
Postgraduate Diploma in Computer Applications
G-CAT Master
Masters in Business Administration
Master of Computer Application (M.C.A.)
Master of Science in Information Technology (M.Sc IT)
Masters Degree in Information Management (MIM)
Post Graduate Programme in Corporate Studies (PGPCS)
Postgraduate Diploma in Management (PGDM)
Programme in Information Security Management
Job Opportunities for BCA Graduates

Given below is an account on the central and state level jobs available for BCA graduates.

Candidates who have finished their degree in computer applications can try out jobs as web-designers or Software Developers. In addition to this, they can also opt for a career in Systems Management. Besides Software development organizations, hardware companies also take in students of BCA.  Private sector jobs after BCA are quite limited. But if the candidates do their Masters in the relevant field, they will get more attractive jobs. Even if they get a job, the salary will be very low.

Another option for the students to choose from is jobs in the IT sectors. Students with a MBA degree can get managerial jobs in this area. There is a chance for the students to get jobs in the area of software programming and development if they have a degree in MCA.

These are some of the fields that a BCA candidate can find employment:

Freelance Writer
Software Analyst
Bank Jobs
Call Centres
Computer System Organizer
Teaching Faculty in IT Institutes.
Technical Outsourcing

Several large organizations in the IT sector such as Tata Consultancy Services,  Accenture, Wipro, Infosys and IBM presents excellent job opportunities as well as good salary packages to freshers. The initial salary will be around 2.5 lakhs - 3.5 lakhs. The Indian defense services also take in graduates and postgraduates of Computer Applications.

Short Term Courses for BCA Graduates

There are several short term courses available for the students to pursue. Some of them are:

Advanced Certificate Course in Computer Application
Hardware Technology
Advanced Certificate Course in Information Technology
Oracle with D2K
Computer Maintenance
Auto CAD
Dot Net
Multimedia, Graphic &
Oracle with DBA
Unix C & C++
V.B. & Oracle
Web Designing & Internet
Web development

Every one of these courses will have a time period of 3-6 months approximately. Students who have good knowledge about these courses will be of high demand in multinational companies. Students can learn these courses ate APTEC, NIIT, JETKING and IIHT etc.

(Please , *Understand the meaning of Font Color)

What is meaning of CRUD?

CRUD stands for Create, Retrieve, Update And Delete.
CRUD full form in computer database: Create, Retrieve, Update And Delete.
CRUD is the abbreviation and an acronym for Create, Retrieve, Update And Delete.

In computer programming, Create, Retrieve, Update And Delete (CRUD) are the four basic functions of persistent storage.
Sometimes CRUD is expanded with the words retrieve instead of read or destroy instead of delete.
It is also sometimes used to describe user interface conventions that facilitate viewing, searching, and changing information, often using computer-based forms and reports.
The term was likely first popularized by James Martin in a 1983 book titled Managing the Data-base Environment.

Related abbreviations:
2NF = Second Normal Form
ACID = Atomicity Consistency Isolation Durability
CAD = Computer-Aided Design
HTTP = Hypertext Transfer Protocol

FTP - This is a service called File Transport Protocol which moves a file between computers using the Internet.

VGA - The Video Graphics Array is a system for displaying graphics. It was developed by IBM.

ISP - The Internet Service Provider is the company which provides Internet service so you can connect your computer to the Internet.

C++ Program: to enter a string and find its length

This program takes in a string x as a screen input from the user.
It then determines the length of the string using the 'strlen' function.
This length is finally outputted using the 'cout' command.

#include <iostream.h>
#include <conio.h>
#include <string.h>

void main()
int slength;
char x[81]; //Allowing the user to input a maximum of 80 characters.
cout << "Enter the string : " << endl;
cout << "The length of the string " << x << " is " << slength << "." << endl;

The length of the string aaabbb is 6.

Structure of Fresher's Resume

  1. Career Objective: This section describes your aim and aspirations. It should be unique, Do NOT copy it from any sample please! Just try to think what you want to do in your career and what qualities in you can benefit the company.
  2. Academics/ Education: You can make a table with the following headers:
    Degree, University, College, Percentage/CGPA and year of Passing and then populate the rows with the latest degree first i.e. first B.E, followed by 12th and then 10th.
    OR you can write the academic details in a clear paragraph format  (Use Table Structure)
  3. Technical Skills: like C++,c,java,
  4. Achievements/ Extra Curricular Activities: Mention any awards that you have won, or extra-curricular activities like , Participated in Stage Drama, Create website for the college, participated in an All India Paper Presentation Competition etc.
  5. Academic Projects:Mention the projects that you did as part of college curriculum or any personal project that you made. Do not forget to mention the duration of project, Name of the organization if you have done it as part of internship, Team Size, and a small 3-4 lines Description.
  6. Personal Details: This section should contain personal Information like your date of birth, your Father's Name, your postal address, Languages Know,.. etc...
*Dont use too much underlines
*Dont use any pictures.
*Dont use colors.
*You resume must be only in Black Font color.
*Maximum and minimum 2 pages for freshers Resume