Top 20 Java Interview Questions | Top 20 Core Java Interview Question Series | Part 3
Top 20 Java Interview Questions | Core Java Interview Question Series | Part 3
This is the third part of the Core Java interview questions Series. In
this article, we will discuss the next 20 JAVA interview questions. For
the previous 40 Java interview questions please
Java Interview question Part 1 Java Interview question Part 2. This will be very helpful for both freshers and experienced
individuals. Hope you like this initiation!Â
If you enjoyed this article, please share it with your friends and support us.
Q.41 What is variable?
Ans. Variable is a container that is used to store the data
Q.42. what is method?
Ans. It is a block of
instuctions that is used to perform a task.
Q.43 What is initializer?
Ans. Initializers are used to execute the startup
application.
Q.44 What does if main method is not present? or can we create a class without main method?
Ans. We can create class without main method. it will compiled
succesfully and the class file is generated but we can excute that
class.
Q.45 What are print() and println() methods
Ans. Both are used to print to statement. But we cannot use te
print statement without passing any data, if we use then we will get a
compile time error. And println() can be used without any data.
Q.46 What are the tokens?
Ans. The smallest unit of programming language which is used to
compose the instruction is known as token.
Note: Software testing jobs service
We have started a Job Updates Service on WhatsApp and email. Those who wish to benefit from this service can subscribe. You will receive daily job updates via a PDF file.
Ping me for more information on 9050358180 .
Note: This is a paid service.
Q.47 Types of tokens?
Ans. 1). Keywords 2). Identifiers 3). Separators 4). Comments 5).
Literals 6). Operators
Q.48 What is separator?
Ans. The separators in Java is also known as punctuatiors. These
are mainly 6 types
1). Curly braces{} 2). Parantheses () 3). Square brackets []Â 4).
Dot 5). Semicolon 6). Comma
Q.49 What are the keywords?
Ans.Â
- These are predefined words which is easily understandable by the compiler
- Every keyword has some specific task
- As a programmer, we can not change the spelling or meaning of the keywords
- Should be in lower case.
- We have 53 keywords in Java
- ex. static class etc.
Q.50 What are the comments?
Ans.Â
- Statement that are ignored by JVM while compile the program
- Line orirented comments : For this , we will use // statement
- Block oriented comments: For this , we will use /* statement */
Q.51 What is convention?
Ans. The coding or industrial standards to be followed by the
programmer are known as conventions. Compiler does not validate the
convention
Q.52 What are the conventions for class?
Ans.Â
- 1st letter should be in upper case
- If multiple words are there then every word should be in upper case remaining should be in lower
- Use meaning name instead for random name
Q.53 What are the conventions for variable?
Ans.
- 1st letter should be in lowe case
- if multiple words are there, then every word should be in lower case followed by an upper case ex. methodName
- Use meaning name instead for random name
Q.54 What are the conventions for packages?
Ans.Â
- Package name should be in lower caseÂ
- if multiple words are then then it should be separated by dots such as java.util
Q.55 What is data and its types?
Ans. The information or details we are using in the programming
language is called data. It is of two types 1). Primitive data 2)
Non primitive dataÂ
Q.56 What are the primitive data ?
Ans. Single value data such as number, charater, boolean are known
as primitive data ex number data, character data, boolean data.
Q.57 What are the non primitive data?
Ans. It is multi-valued data such as object reference, string
data, null etc.
Q.58 What is object reference?
Ans. In Java, it is not disclosed original address of object
instead of that its disclosing reference address to access the object
property , this is known as object reference. Object reference is
represented by className @hexadecimal_Value
Q.59 What is string data?
Ans. The data which is enclosed in double quotes is known as
string data. String are case sensitive and immutable.
Q.60 What is null
Ans. It is a keyword or reserved word in java as a value. We
cannot change the spelling of null. It is the default value for the non
primitive data types
Hope you like this article!
Thanks,
Rajat Bhatti
Subscribyoutube channe:Tech Bharat youtube
Linkedin:Let's connect on LinkedIn.
For more details Join our Whatsup Group :Â Whatup Group
To get daily job updates on software testing:Â To get Daily Job updates, click me
9050358180
For more details Join our Whatsup Group :Â Whatup Group
To get daily job updates on software testing:Â To get Daily Job updates, click me
9050358180
Post a Comment