[Go to site: main page, start]

0% found this document useful (0 votes)
2 views8 pages

Core Java &SQL

The document contains a comprehensive list of Java and SQL interview questions covering fundamental concepts such as variables, methods, inheritance, polymorphism, exception handling, and SQL queries. It includes explanations of key differences between various programming constructs, as well as practical programming tasks. The content serves as a study guide for individuals preparing for technical interviews in Java and SQL.

Uploaded by

lyricistlunar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

Core Java &SQL

The document contains a comprehensive list of Java and SQL interview questions covering fundamental concepts such as variables, methods, inheritance, polymorphism, exception handling, and SQL queries. It includes explanations of key differences between various programming constructs, as well as practical programming tasks. The content serves as a study guide for individuals preparing for technical interviews in Java and SQL.

Uploaded by

lyricistlunar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JAVA INTERVIEW QUESTIONS

INTERVIEWQUESTIONS
1. What1s Variable?
2. What is Method?
3. What is Method Overloading?
4. What is Method Overriding?
5. Whatstype castiny?
6. Explain Primitive and Non-Primive.
7. What is Inheritance? Why multiple Inheritance is notpossible
through Java classes?
8. What is Polymorphism? Explain its ypes.
9. What is Interface and Abstract clas?
[Link] is the difference between static and non-static?
[Link] is encapsulation? And what is java bean class?
[Link] is exception handling? And how to handle it?
[Link] is collectian? Explainthe collectionclasses with an example.
[Link] a program for pass by reference with a real time example.
15. What is composition?
16. Why java is called abject oriented programming language?
[Link] are the java features?
"It is compiled.
"Itis Robust.
"It is highly secured language.
" It is simple and easy tounderstand.
"High performance.
"Multithreaded.
" It is platform independent.
[Link] is the difference between methods and constructors?

It is used to perform some It is used to initialize data


operations. members.
It willhave return type. It will not have any return
type.
We can overload and We can overload but cannot
override it. override it.
It can be class1ned into It's always nonstatic
static and non-static
It can be inherited. Cannotbe inherited.
It can be any name even Isbould always be sameas
css name. dass name.
It will b called or R wiitbe invoked
invoked by name. vwhenever agobject fis
cre ited.
It canreturn any value. It doesn't return any value.
It should be Geveloped Each and very class will
explicitly. havea constructor.

[Link] is the difference between this keyword and super keyword?

THIS keyword is dsed to SUPER keyword is used in the


point to the current object. case of method overriding
along with the subclass
implementation, if we need
super class implementation
then we should go for SUPER
keyword.
Whenever a global and In the case of method
local variable names are overriding we use SUPER
same then we should go keyword.
for THIS keyword.
THIS keyword can be used SUPER keyword can be used
only in the non-static only in non-static context.
context because internally
Skeyword non-static.

20. Which keyword is the default reference vaiable in java?


>THIS keyword.
Developing multiple Developing a sub cdasswi
methods with same name same name and signature as
but variation in the in thesuper dass but with
argument list is called as Jifferent implementation in
method overloading. the sub class iscalled method
overiding
We can overload bot static We can override ony non
and non-static. static.
The method name should The complete signature
be same but there is no should be same in the sub
restrictions on the access class as in the super class.
specifier, modiñer and
return type.
It isused to perform some When we want new
operations. implementation we go for
method overriding.
There is no rule that it It should have IS Arelation ship
should have IS A toachieve overriding.
relationship.
It is an
example for compile It is an
time polymorphism
We can
overload example for run time
method main
polymorphism.
We
cannot override main
22. What is the method.
[Link] main difference between this
args) ? method is declared as publiccalling and super calling?
-Spublic is static void main(
application level Stringl
access the main method access where JVM should be
It is static hence it is
declared able to
because it should be loaded into the public.
as
execution and it should be one copy. memory beforeb
neturn type is void because it A
Min is method
name. doesn't return any value.
The parameters are
stringl argsbecause
staringl] format at the omnand line.
JI it NE
recejves input in the
Command
Class Demo
prompt.
{
Public static void main(Stringll args)

String[] arr={"Hi"Hello";
For(int i=0;i<[Link];i++)

S.O.P("arrlil;

}
Compilation: javac [Link]
Interpretation: javaDemo "$97a" /*input isgiven in command
promt/
Eclipse
Package collectiontopic;
Puhlc class sample
PS.V.M()

For (int i [Link];i +)


S.o.P("argsil):

M/Run->Run confir>arquments we should pass.


[Link] is the difference between abstracteBass and Interface?
Anyclass which is declared Interface is ajavá typà which
with akeyword abstract is is by default &bstract.
called abstract class.
In abstract class we have 3 In interfacewe have2
members. members.
Inabstract class we have Wedon't have constructor.
constructor
Variables in abstract class Variables in interface is by
tic andnon-static. default static and final,
can be static
Methods can have access Methods are by default
specifier. publicand abstract.
We can develop both We can develop only abstract
abstract and concrete methods.
methods.
We have to override allthe Allthe methodsshould be
abstract methods in the sub overridden.
class but not in the concrete
class.
Absarct class extends Interface doesn't extend any
object class. class.
Through abstract class we Throug inte face weccannot
can achieve constructor achieve constructor chain
chain. because it doesn't support
constructor
When we know partial When we don't know %
implementation then we implementation the we should
should go for abstraction. go for interface.

25. What is constructor chaining?


BA subclass constructor calling its immediate superclass
constructor, super class constructor calling itsimmediate super
class constructor is called as constructor chaining.
26. What is the difference error and exception?
Error cannot be predicted. Exception can be predicted.
Errors are occurred due to Exceptions are occurred due
the system configuration. to the mistakes done by the
programmer.
Error cannot be handled. Exception can be handled.
R
27. Write aprogram to reverse astring
i/p:JAVA MAVA JOBAA
o/p: JOBAA MAVA JAVA
class Demo

P.S.V.M( S p i d e r

string s1="JAVA MAVA JOBAA":


String []arr=[Link]("");
For(int i=[Link]-1;i>=0;i++)
{
S.O.P(arrlil): R A J A J I N A G

}
SQL INTERVIEW QUESTIONS

INTERVIEW QUESTIONS

[Link] to find Nth highest salary


[Link] Joins in Sql?
[Link] are the constraints in SQL?
A G A R
[Link] are Aggregate Functions?
[Link]/w pk and FK
[Link] is Normalization &Why is it needed?
[Link] are the Different types of sql commands?
[Link] between DELETE,TRUNCATE &DROP?
[Link] between WHERE &HAVING?
[Link] between GROUPBY &ORDERBY?
[Link] between CHAR &VARCHAR?
[Link] between UNION & UNIONALL?
[Link] is pattern matching in sql?
[Link] is UNION,MINUS &INTERSET?
[Link] between UNION &JOIN?
[Link] is view, stored procedure?
[Link] DBMSand rdbms
[Link] and every syntax
[Link] subquery and co-related subquery
[Link] distinct and unique
[Link] srf and MRF

You might also like