SlideShare a Scribd company logo
www.javaquestionbank.net 1
Java Question & Answer by KK Matam
- share ur Knowledge and multiply it.
www.javaquestionbank.net 2
Q)Is it possible to provide a class inside an Interface?
==========================================
Yes,it is possible to declare a class inside an interface.If we declare a class inside an interface
then that class is becoming as static inner class,where we can access the members like static
inner class members.
example
interface I{
class A
{
void m1(){
System.out.println("m1-A");}
void m2(){
System.out.println("m2-A");}}
}
class Test
{
public static void main(String args[]){
I.A ia=new I.A();
ia.m1();
ia.m2();
}
}
www.javaquestionbank.net 3
What is Method local Inner Class?
===========================
Ans:
•Declaring a class Inside a method is called as Method Local Inner class.
•
If we declare a class inside a method then that class is having scope upto the respective method.
•In the case of method local Inner classes,we have to create object for the Inner class and we
have to access members of the inner class inside the respective method only.
www.javaquestionbank.net 4
Q: What are the differences between Web Servers and Application Servers?
Ans:
1. Web Server is a server, which will provide very good environment to execute web
applications only. But Application servers will provide very good environment to execute any
type of J2EE applications like web applications, distributed applications and so on.
2. In general web servers will not provide all the middle ware services.
But application servers will provide all the middle ware services like JND, Jdbc and so on as
in-built support.
Application server = Web server + Middleware services
Note: Initially the main intention of web servers is to execute static resources
in order to generate static response and the main intention of application servers is to
execute dynamic resources in order to generate dynamic response.
www.javaquestionbank.net 5
Q: What is the difference between POST request and PUT request?
Ans:
Both POST request and PUT request can be used to upload the data on the server machine.
To upload the data on server machine if we use POST request then it is not mandatory to specify
particular address location along with POST request.
To upload the data on server machine if we use PUT request then it is
mandatory to specify server side location along with PUT request.
www.javaquestionbank.net 6
Q: What is the difference between GET request and HEAD request?
Ans:
If we send Get request for a particular resource available at server machine then
server will send only the requested resource as a response to client.
If we send HEAD request for a particular resource available at server then server will send
requested resource as well as the metadata about the requested resource as response.
Note: Internally HEAD request uses GET request to get the requested resource from server.
www.javaquestionbank.net 7
For more visit us on:
www.javaquestionbank.net
Fbpage :
www.facebook.com/JavaEncyclopedia

More Related Content

Similar to Java Question & Answers - I (20)

PDF
11.Object Oriented Programming.pdf
Export Promotion Bureau
 
DOCX
Bt0074, oops with java
smumbahelp
 
PDF
java basic .pdf
Satish More
 
DOCX
Latest .Net Questions and Answers
Narasimhulu Palle
 
PPTX
Advance java Online Training in Hyderabad
Ugs8008
 
PDF
JCD 2013 OCM Java Developer
益裕 張
 
PDF
OCM Java 開發人員認證與設計模式
CodeData
 
DOCX
Bt0074 oop with java
smumbahelp
 
PDF
Java ppt Gandhi Ravi ([email protected])
Gandhi Ravi
 
PPTX
Unit No 3 Inheritance annd Polymorphism.pptx
DrYogeshDeshmukh1
 
PDF
Top 100 .Net Interview Questions and Answer
Vineet Kumar Saini
 
PDF
Hibernate by l n rao
Urs'Truly V'Nayak
 
PDF
Networking
Ravi Kant Sahu
 
PPTX
4 jdbc step1
myrajendra
 
PDF
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
nofakeNews
 
DOCX
Mi0041 java and web design
smumbahelp
 
PDF
Java Interview Questions Answers Guide
DaisyWatson5
 
DOCX
Mit103 object oriented programming
smumbahelp
 
PDF
Core java interview questions
Rohit Singh
 
DOCX
Viva file
anupamasingh87
 
11.Object Oriented Programming.pdf
Export Promotion Bureau
 
Bt0074, oops with java
smumbahelp
 
java basic .pdf
Satish More
 
Latest .Net Questions and Answers
Narasimhulu Palle
 
Advance java Online Training in Hyderabad
Ugs8008
 
JCD 2013 OCM Java Developer
益裕 張
 
OCM Java 開發人員認證與設計模式
CodeData
 
Bt0074 oop with java
smumbahelp
 
Java ppt Gandhi Ravi ([email protected])
Gandhi Ravi
 
Unit No 3 Inheritance annd Polymorphism.pptx
DrYogeshDeshmukh1
 
Top 100 .Net Interview Questions and Answer
Vineet Kumar Saini
 
Hibernate by l n rao
Urs'Truly V'Nayak
 
Networking
Ravi Kant Sahu
 
4 jdbc step1
myrajendra
 
JAVA VIVA QUESTIONS_CODERS LODGE.pdf
nofakeNews
 
Mi0041 java and web design
smumbahelp
 
Java Interview Questions Answers Guide
DaisyWatson5
 
Mit103 object oriented programming
smumbahelp
 
Core java interview questions
Rohit Singh
 
Viva file
anupamasingh87
 

Recently uploaded (20)

PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Top Managed Service Providers in Los Angeles
Captain IT
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
Ad

Java Question & Answers - I

  • 1. www.javaquestionbank.net 1 Java Question & Answer by KK Matam - share ur Knowledge and multiply it.
  • 2. www.javaquestionbank.net 2 Q)Is it possible to provide a class inside an Interface? ========================================== Yes,it is possible to declare a class inside an interface.If we declare a class inside an interface then that class is becoming as static inner class,where we can access the members like static inner class members. example interface I{ class A { void m1(){ System.out.println("m1-A");} void m2(){ System.out.println("m2-A");}} } class Test { public static void main(String args[]){ I.A ia=new I.A(); ia.m1(); ia.m2(); } }
  • 3. www.javaquestionbank.net 3 What is Method local Inner Class? =========================== Ans: •Declaring a class Inside a method is called as Method Local Inner class. • If we declare a class inside a method then that class is having scope upto the respective method. •In the case of method local Inner classes,we have to create object for the Inner class and we have to access members of the inner class inside the respective method only.
  • 4. www.javaquestionbank.net 4 Q: What are the differences between Web Servers and Application Servers? Ans: 1. Web Server is a server, which will provide very good environment to execute web applications only. But Application servers will provide very good environment to execute any type of J2EE applications like web applications, distributed applications and so on. 2. In general web servers will not provide all the middle ware services. But application servers will provide all the middle ware services like JND, Jdbc and so on as in-built support. Application server = Web server + Middleware services Note: Initially the main intention of web servers is to execute static resources in order to generate static response and the main intention of application servers is to execute dynamic resources in order to generate dynamic response.
  • 5. www.javaquestionbank.net 5 Q: What is the difference between POST request and PUT request? Ans: Both POST request and PUT request can be used to upload the data on the server machine. To upload the data on server machine if we use POST request then it is not mandatory to specify particular address location along with POST request. To upload the data on server machine if we use PUT request then it is mandatory to specify server side location along with PUT request.
  • 6. www.javaquestionbank.net 6 Q: What is the difference between GET request and HEAD request? Ans: If we send Get request for a particular resource available at server machine then server will send only the requested resource as a response to client. If we send HEAD request for a particular resource available at server then server will send requested resource as well as the metadata about the requested resource as response. Note: Internally HEAD request uses GET request to get the requested resource from server.
  • 7. www.javaquestionbank.net 7 For more visit us on: www.javaquestionbank.net Fbpage : www.facebook.com/JavaEncyclopedia