Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Â
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.