SlideShare a Scribd company logo
JAVA Interview Questions and Answers:
Can a constructor be made final?
No, thisis not possible.
staticmembersbelong to a class, but the constructor is needed to create an object. An abstract classis a
partiallyimplemented class,which containsabstract methods to be implemented in child class. final
restrictsmodification: variablesbecome constant, methodscan't be overridden, and classes can't be
inherited.
No. constructors are similar to methods,but cannot be invoked directlyby a method call. They are used
to initialize new class instances.Like methods, theymay be overloaded
What is the APK format?
The Android packaging key is compressed with classes,UI's, supportive assetsand manifest.All filesare
compressed to a single file is called APK.
APK standsfor android Application Package File(APK), it is zip file formatted packages based on the
android application code.
Android application package (APK) is the package file format used by the Android operatingsystem for
distribution and installation of mobile appsand middleware. APK filesare analogous to other software
packages such as APPXin Microsoft Windows or Deb packages in Debian-based operatingsystemslike
Ubuntu.
What do you know about Java?
Java is a high-level programminglanguage originallydeveloped bySun Microsystems and released in
1995. Java runs on a varietyof platforms, such as Windows, Mac OS, and the various versions of UNIX.
Some of the advantagesof the Java:
 The code is compiled into bytecode, it is like code once and run anywhere. It eliminatesthe need for
platform-specificversions.
 Unlike other languages,the code is very robust.
 Object-oriented language.
 The appletsrunsfaster
 Compared to C++, Java is easy to learn.
Java is an portable language which supportsobject oriented featureslike inheritance,polymorphism and
encapsulation and it is platform independent once compile and run any where with the help of JVM.IN
JVM we have native stack which is used to store non java code and it helps the programer to covert it to
java code.
What is stored procedure?
1. Stored procedure is a pre-compiled Sql statements. 2. That meansstored procedure will contain sql
statementslike SELECT, UPDATE, DELETE and so on which is alreadycompiled. Syntax: Create
procedure procedurename () As Begin { } end
A stored procedure is a bunch of SQL statementsthat are stored in the DB. The different types of stored
procedures; a) System Stored Procedures b) User Defined Stored Proceduresc) Extended Stored
Procedures.These procedureswill accept input parametersso that a single procedure can be called by
several clients. The benefits of the Stored Procedures are: - Faster Execution - Implementsmodule
programming - Minimize the networktraffic
Stored procedure is simplya set operationsperformed on table...with different conditions.
what is boolean?
Boolean valuesare the two constant objects True and False, are used to represent truth values(other
valuescan also be considered false or true).
In numericcontexts (for example, when used as the argument to an arithmeticoperator), they behave
like the integers0 and 1, respectively.
The built-in function bool() can be used to cast any value to a Boolean, if the value can be interpreted as
a truth value.
This is very basic answer, can some body add more points
Boolean or bool consists of operators such as AND, OR, NOT and XOR. Booleans are commonly used in programming to set
the result in the value of TRUE or FALSE.
I am searching for free JSON API string to build
my demo application, any references?
I found couple of links, which might be useful for your requirement.
- https://www.reddit.com/.json (without CORSrestriction)
- http://chancejs.com
- http://jsonplaceholder.typicode.com
You have to build a backend using php for example. Set specific URI's for specific functionality to handle
POST or GET requests.For example for login purposes you can set a url //example.com/login and send
your login username and password.
On that link your PHP getsthe data, and logs or rejectsto log the user according the the data. Or you can
get just information from the database. For example //example.com/getpost/?id=1. From the linkyou
php gets the Id, and after fetchingthe data from the database, buldsas a json, and returnsthe data.
When should you use Div, Section or Article?
Div : Div is a block element.
Section: section groups the content related to a single concept / topic, its like a subsection of a major
article. Similar to a new paper section, it might have header, body and footer (may be).
Article: you can understand it asa complete document, which can be distributable asindependent
component.
It makes no difference when you are looking from the view of designer!There are all html blocks, which
you can change, manage usingcss as you want the same way. It makesmore sense when your are
looking on them from the view of SEO. It makesreally much more difference!In articlesSearch engines
are looking for articlesfirst, and for articlessearch engines are looking in articlestag. So You deside
when to use which one. Sections are more for logical sections, when your tryingto divide your page to
logical sections, not usingmany divs which will make your html structure more complicated. They came
to help to structure more effective, and easy.
public static void main(String []args) in detail
thisis we called asmain method.atleast in one place it should exist in a program.
here
"public" will defines"access modifier",
static will define "type of method"by which we need to decide either we need to refer with "classname"
r "objectname".
void will define "return tye of the method".
"(string[ ]args)" will defines "object of args of string class".
Java is a pure Object Oriented Language. Anythingyou write in a Java Program should reside in a Class.
Assume you have write a simple java program. So you write a Classnamed that containsthe methods
which perform your logic.
Now to run your logic you have to create an object to your class. So to create an object you should have
atleast one method that have access with out creating an object. Hence the main method was declared
as "static". Now the Java Virtual Machine(JVM) can call the main method as ClassName.main()
public is the access specifier which tells that the main method can be accessed from outside the class.
void is the return type of the main method.
String[] args is used to pass any arguments. Java only accepts the array of Stringsas arguments.
Why Constructor name is same as Class name
Constructor is called immediatelyafter an object of a class is created. To reduce the number of keywords
in Java, name of the constructor is defined same as the Class name. The Java developersdon't want to
include new keyword for constructor. They want to keep it simple and precise.
So that it can be unambigouslyidentified asthe constructor. and how its get invoked implicitlywhen we
create object of that class. It is invoked by the compiler because it hasalreadybeen unambiguously
identified because of itsnamingsheme.
What is the difference between a Window and a
Frame?
The Frame class extends Window to define a main application window that can have a menu bar.
Frame: It is a window with title bars and borders.It is within a window and It has title bar,
border, close button, minimize button, resizable and movable options.Frame is a part of a
window.
Window: It is an imaginary rectangle area on the monitor.It does not have title bar, border and any
close button.
Window is not a part of window.
Frame:
1.It is a window with title barsand borders.
2.Frame is within a window.
3.It has title bar, border, close button, minimize button, resizable and movable options.
4.Frame is a part of a window.
Window:
1.It is an imaginaryrectangle area on the monitor.
2.Window will not in a frame.
3.It does not have title bar, border and any close button.
4.Window is not a part of window.
Ad

More Related Content

What's hot (18)

Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
Sri K
 
C# Advanced L07-Design Patterns
C# Advanced L07-Design PatternsC# Advanced L07-Design Patterns
C# Advanced L07-Design Patterns
Mohammad Shaker
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
Math-Circle
 
Hibernate introduction
Hibernate introductionHibernate introduction
Hibernate introduction
Sagar Verma
 
Basics of Java
Basics of JavaBasics of Java
Basics of Java
Sherihan Anver
 
Class 1
Class 1Class 1
Class 1
Dario Pilozo
 
Object oriented programming-with_java
Object oriented programming-with_javaObject oriented programming-with_java
Object oriented programming-with_java
Hoang Nguyen
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
backdoor
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
Kuntal Bhowmick
 
JAVA PROGRAMMING- Exception handling - Multithreading
JAVA PROGRAMMING- Exception handling - MultithreadingJAVA PROGRAMMING- Exception handling - Multithreading
JAVA PROGRAMMING- Exception handling - Multithreading
Jyothishmathi Institute of Technology and Science Karimnagar
 
Class 1 blog
Class 1 blogClass 1 blog
Class 1 blog
Narcisa Velez
 
Java notes
Java notesJava notes
Java notes
Upasana Talukdar
 
Java training in delhi
Java training in delhiJava training in delhi
Java training in delhi
APSMIND TECHNOLOGY PVT LTD.
 
Java interview questions 1
Java interview questions 1Java interview questions 1
Java interview questions 1
Sherihan Anver
 
50+ java interview questions
50+ java interview questions50+ java interview questions
50+ java interview questions
SynergisticMedia
 
Java interview-questions-and-answers
Java interview-questions-and-answersJava interview-questions-and-answers
Java interview-questions-and-answers
bestonlinetrainers
 
Java interview questions 2
Java interview questions 2Java interview questions 2
Java interview questions 2
Sherihan Anver
 
Java Presentation For Syntax
Java Presentation For SyntaxJava Presentation For Syntax
Java Presentation For Syntax
PravinYalameli
 

Similar to Java interview questions and answers (20)

Object Oriented Programming unit 1 content for students
Object Oriented Programming unit 1 content for studentsObject Oriented Programming unit 1 content for students
Object Oriented Programming unit 1 content for students
ASHASITTeaching
 
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 
Unit 1 – Introduction to Java- (Shilpa R).pptx
Unit 1 – Introduction to Java- (Shilpa R).pptxUnit 1 – Introduction to Java- (Shilpa R).pptx
Unit 1 – Introduction to Java- (Shilpa R).pptx
shilpar780389
 
Javanotes
JavanotesJavanotes
Javanotes
John Cutajar
 
Introduction
IntroductionIntroduction
Introduction
richsoden
 
Java
JavaJava
Java
Sneha Mudraje
 
Class 1
Class 1Class 1
Class 1
Dario Pilozo
 
Example Of Import Java
Example Of Import JavaExample Of Import Java
Example Of Import Java
Melody Rios
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
akreyi
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
Rich Helton
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
Gradeup
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
Rich Helton
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Prg421
Prg421Prg421
Prg421
john roy
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
PawanMM
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
Bharath Choudhary
 
Viva file
Viva fileViva file
Viva file
anupamasingh87
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
Madhura Bhalerao
 
Introduction to Core Java Programming
Introduction to Core Java ProgrammingIntroduction to Core Java Programming
Introduction to Core Java Programming
Collaboration Technologies
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
J. C.
 
Object Oriented Programming unit 1 content for students
Object Oriented Programming unit 1 content for studentsObject Oriented Programming unit 1 content for students
Object Oriented Programming unit 1 content for students
ASHASITTeaching
 
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 
Unit 1 – Introduction to Java- (Shilpa R).pptx
Unit 1 – Introduction to Java- (Shilpa R).pptxUnit 1 – Introduction to Java- (Shilpa R).pptx
Unit 1 – Introduction to Java- (Shilpa R).pptx
shilpar780389
 
Introduction
IntroductionIntroduction
Introduction
richsoden
 
Example Of Import Java
Example Of Import JavaExample Of Import Java
Example Of Import Java
Melody Rios
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
akreyi
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
Rich Helton
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
Gradeup
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
Rich Helton
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
PawanMM
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
Bharath Choudhary
 
Chapter1pp
Chapter1ppChapter1pp
Chapter1pp
J. C.
 
Ad

Recently uploaded (20)

EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Xforce Keygen 64-bit AutoCAD 2025 Crack
Xforce Keygen 64-bit AutoCAD 2025  CrackXforce Keygen 64-bit AutoCAD 2025  Crack
Xforce Keygen 64-bit AutoCAD 2025 Crack
usmanhidray
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key  With LatestAdobe Photoshop CC 2025 Crack Full Serial Key  With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
usmanhidray
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Xforce Keygen 64-bit AutoCAD 2025 Crack
Xforce Keygen 64-bit AutoCAD 2025  CrackXforce Keygen 64-bit AutoCAD 2025  Crack
Xforce Keygen 64-bit AutoCAD 2025 Crack
usmanhidray
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key  With LatestAdobe Photoshop CC 2025 Crack Full Serial Key  With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
usmanhidray
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Ad

Java interview questions and answers

  • 1. JAVA Interview Questions and Answers: Can a constructor be made final? No, thisis not possible. staticmembersbelong to a class, but the constructor is needed to create an object. An abstract classis a partiallyimplemented class,which containsabstract methods to be implemented in child class. final restrictsmodification: variablesbecome constant, methodscan't be overridden, and classes can't be inherited. No. constructors are similar to methods,but cannot be invoked directlyby a method call. They are used to initialize new class instances.Like methods, theymay be overloaded What is the APK format? The Android packaging key is compressed with classes,UI's, supportive assetsand manifest.All filesare compressed to a single file is called APK. APK standsfor android Application Package File(APK), it is zip file formatted packages based on the android application code. Android application package (APK) is the package file format used by the Android operatingsystem for distribution and installation of mobile appsand middleware. APK filesare analogous to other software packages such as APPXin Microsoft Windows or Deb packages in Debian-based operatingsystemslike Ubuntu. What do you know about Java? Java is a high-level programminglanguage originallydeveloped bySun Microsystems and released in 1995. Java runs on a varietyof platforms, such as Windows, Mac OS, and the various versions of UNIX. Some of the advantagesof the Java:  The code is compiled into bytecode, it is like code once and run anywhere. It eliminatesthe need for platform-specificversions.  Unlike other languages,the code is very robust.  Object-oriented language.  The appletsrunsfaster  Compared to C++, Java is easy to learn. Java is an portable language which supportsobject oriented featureslike inheritance,polymorphism and encapsulation and it is platform independent once compile and run any where with the help of JVM.IN JVM we have native stack which is used to store non java code and it helps the programer to covert it to java code.
  • 2. What is stored procedure? 1. Stored procedure is a pre-compiled Sql statements. 2. That meansstored procedure will contain sql statementslike SELECT, UPDATE, DELETE and so on which is alreadycompiled. Syntax: Create procedure procedurename () As Begin { } end A stored procedure is a bunch of SQL statementsthat are stored in the DB. The different types of stored procedures; a) System Stored Procedures b) User Defined Stored Proceduresc) Extended Stored Procedures.These procedureswill accept input parametersso that a single procedure can be called by several clients. The benefits of the Stored Procedures are: - Faster Execution - Implementsmodule programming - Minimize the networktraffic Stored procedure is simplya set operationsperformed on table...with different conditions. what is boolean? Boolean valuesare the two constant objects True and False, are used to represent truth values(other valuescan also be considered false or true). In numericcontexts (for example, when used as the argument to an arithmeticoperator), they behave like the integers0 and 1, respectively. The built-in function bool() can be used to cast any value to a Boolean, if the value can be interpreted as a truth value. This is very basic answer, can some body add more points Boolean or bool consists of operators such as AND, OR, NOT and XOR. Booleans are commonly used in programming to set the result in the value of TRUE or FALSE. I am searching for free JSON API string to build my demo application, any references? I found couple of links, which might be useful for your requirement. - https://www.reddit.com/.json (without CORSrestriction) - http://chancejs.com - http://jsonplaceholder.typicode.com
  • 3. You have to build a backend using php for example. Set specific URI's for specific functionality to handle POST or GET requests.For example for login purposes you can set a url //example.com/login and send your login username and password. On that link your PHP getsthe data, and logs or rejectsto log the user according the the data. Or you can get just information from the database. For example //example.com/getpost/?id=1. From the linkyou php gets the Id, and after fetchingthe data from the database, buldsas a json, and returnsthe data. When should you use Div, Section or Article? Div : Div is a block element. Section: section groups the content related to a single concept / topic, its like a subsection of a major article. Similar to a new paper section, it might have header, body and footer (may be). Article: you can understand it asa complete document, which can be distributable asindependent component. It makes no difference when you are looking from the view of designer!There are all html blocks, which you can change, manage usingcss as you want the same way. It makesmore sense when your are looking on them from the view of SEO. It makesreally much more difference!In articlesSearch engines are looking for articlesfirst, and for articlessearch engines are looking in articlestag. So You deside when to use which one. Sections are more for logical sections, when your tryingto divide your page to logical sections, not usingmany divs which will make your html structure more complicated. They came to help to structure more effective, and easy. public static void main(String []args) in detail thisis we called asmain method.atleast in one place it should exist in a program. here "public" will defines"access modifier", static will define "type of method"by which we need to decide either we need to refer with "classname" r "objectname". void will define "return tye of the method". "(string[ ]args)" will defines "object of args of string class". Java is a pure Object Oriented Language. Anythingyou write in a Java Program should reside in a Class. Assume you have write a simple java program. So you write a Classnamed that containsthe methods which perform your logic. Now to run your logic you have to create an object to your class. So to create an object you should have atleast one method that have access with out creating an object. Hence the main method was declared as "static". Now the Java Virtual Machine(JVM) can call the main method as ClassName.main() public is the access specifier which tells that the main method can be accessed from outside the class.
  • 4. void is the return type of the main method. String[] args is used to pass any arguments. Java only accepts the array of Stringsas arguments. Why Constructor name is same as Class name Constructor is called immediatelyafter an object of a class is created. To reduce the number of keywords in Java, name of the constructor is defined same as the Class name. The Java developersdon't want to include new keyword for constructor. They want to keep it simple and precise. So that it can be unambigouslyidentified asthe constructor. and how its get invoked implicitlywhen we create object of that class. It is invoked by the compiler because it hasalreadybeen unambiguously identified because of itsnamingsheme. What is the difference between a Window and a Frame? The Frame class extends Window to define a main application window that can have a menu bar. Frame: It is a window with title bars and borders.It is within a window and It has title bar, border, close button, minimize button, resizable and movable options.Frame is a part of a window. Window: It is an imaginary rectangle area on the monitor.It does not have title bar, border and any close button. Window is not a part of window. Frame: 1.It is a window with title barsand borders. 2.Frame is within a window. 3.It has title bar, border, close button, minimize button, resizable and movable options. 4.Frame is a part of a window. Window: 1.It is an imaginaryrectangle area on the monitor. 2.Window will not in a frame. 3.It does not have title bar, border and any close button. 4.Window is not a part of window.