[go: up one dir, main page]

0% found this document useful (0 votes)
3 views5 pages

First Mock Intervie Questions

The document contains a comprehensive list of questions for a mock Java interview, covering fundamental concepts such as language definitions, Java features, OOP principles, data types, and constructors. It also includes coding questions that require writing Java programs for various tasks, such as checking for palindromes, counting digits, and generating patterns. Overall, it serves as a guide for preparing for a Java programming interview.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

First Mock Intervie Questions

The document contains a comprehensive list of questions for a mock Java interview, covering fundamental concepts such as language definitions, Java features, OOP principles, data types, and constructors. It also includes coding questions that require writing Java programs for various tasks, such as checking for palindromes, counting digits, and generating patterns. Overall, it serves as a guide for preparing for a Java programming interview.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Questions for mock interview:

--------------------------------
1. What is language?
2. What are the flavors/versions of java?
3. What are the features of Java?
4. What is Java?
5. What are the advantages of java?
6. What is source code?
7. What is byte code?
-> What is a .class file?
8. What is platform?
9. What do you mean by Platform independent programming language?
-> Is java platform independent language?
-> Is JVM platform independent or dependent?
10. What makes java platform independent programming language?
11. What is compiler , JVM, JDK and JIT?
-> What is the work of interpreter?
12. What is the meaning of WORA?
13. What is main method?
14. Why main method is static?
15. Can we change the return type of main method?
16. Can we change/remove the parameter from main method?
17. Can we change the public and static place to reverse in main method?
18. What part we can change in main method ?
19. Can we execute a class without main method?
20. Can we develop a empty class?
21. Can we execute a empty class?
22. Why main method is public , static , void and why the name is main and why the
parameter is String[] ?
23. What do you mean by command line argument?
24. What is token and how many types of tokens are there?
25. What is keyword and how many keywords are there in java?
26. What is identifier?
27. What are the rules to follow while creating an identifier?
28. What is Literals and how many literals are there?
29. What are the punctuators?
30. What is operator and how many operators are there?
-> What is the work of bitwise operator?
-> What is the work of ternary operator?
-> What is the work of shift operator?
-> What is the work of Logical operator?

-> What are the conditional statements are there?


-> What is the difference between if condition and switch?
-> What data types are allowed for switch case?
-> What are the loops we have in java?
-> What are the transfer/branching statements.

31. What is datatype and types of data type ?


32. What are the primitive data type are there in java?
33. Flow of data type based on size?
34. What are the reference data type are there?
35. What is method and types of method?
36. What is OOP?
37. What are the features of OOP?
38. What are the pillars of OOP?
39. What is class and object?
-> Can we create a private class?
-> Can we create a protected class?
40. What are the characteristics of object?
-> How many ways we can create object in Java?
41. What do you mean by state, behaviour and identity of an object explain.
42. How to create object and how many ways we can create object?
43. What is the role of new keyword?
44. What is constructor?
45. What are the rules to follow while declaring constructor?
46. Syntax of constructor?
-> How to call a constructor?
-> Can we call a constructor by using object reference?
47. How many types of constructor and explain each?
48. What are the difference between constructor and method?
49. Why constructor name is same as the class name?
-> Can we change the constructor name to another name?
50. What is the difference between no-param constructor and default constructor ?
51. Can we add return type to constructor ?
52. Can we define a method name same as class name.
53. If we can define method name and constructor name same then how JVM and
compiler differentiate which one is constructor and which one is method?
54. Can we develop multiple constructor in same class?
55. What is constructor overloading?
56. What are the rules to follow while constructor overloading?
57. How to call a constructor from another constructor?
58. Use of super() and this() in constructor.
59. Can we write both this() and super() in a constructor?
60. Is it mandatory to write super() or this()in constructor?
61. What is constructor chaining?
62. What is copy constructor?
63. What is current object?
64. What is this keyword?
65. What is the use of this keyword?
66. What is variable shadowing?
67. What is data hiding?
68. What is encapsulation?
69. What is the use of setter and getter method?
70. What is tightly encapsulated class and loosely encapsulation?
71. How to achieve encapsulation?
72. Java supports how many relations?
73. What is Is-A relation?
74. What is inheritance?
75. By using which keywords we can achieve inheritance?
76. Types of inheritance?
77. Why java does not supports multiple inheritance with classes ?
78. What is non-static block and what is the use of it?
79. What are the access modifiers?
-> scope of public
-> scope of protected
-> scope of private
-> scope of private
80. What are the advantages of inheritance?
81. Purpose of inheritance?
-> What is blank final field and what is the procedure to initialize it.
-> What is variable hiding?
82. Explain JVM Architecture?
83. What is class Loder?
84. How many class loaders are there?
85. What is the work of class loader?
86. Explain JVM runtime area.
CODING QUESTIONS
================

Que 1 : Write a java program the given number is palindrom or not.


Given number : 121
Output = palindrom

-----------------------------

Que 2 : Write a java program to find count of digit of given number.


Given number : 6372
Output = 4

-----------------------------

Que 3 : Write a program to print fibonacci serise for given number .


Given number : 7
Output = 0 1 1 2 3 5 8

-----------------------------

Que 4 : Write a java program to check given number is armstrong or not.


Given input : 153
Output : 153 is armstrong number.

-----------------------------

Que 5 : Write a java program to print all armstrong numbers between given range.
(in this question iterviewer wants to check logic for multidigit armstrong
number like 4,5..n digit.)
given range : 100 to 10000
Output :
153
370
371
407
1634
8208
9474

-----------------------------

Que 6 : Write a java program to check given number is perfect number or not.
Explanation : sum of divisors is equal to given number then its known as
perfect number. for example 6 is perfect number because(1+2+3 = 6)
Given number : 6
Output : true
Given number : 28
Output : true
Given number : 7
Output : false

-----------------------------

Que 7 : Write a java program to check given number number is prime or not.
Given input : 7
Output : true
Given input : 4
Output : false

-----------------------------

Que 8 : Write a java program to print given pattern

*
* *
* * *
* * * *
* * * * *

-----------------------------

Que 9 : Write a java program to print given pattern

*
* *
* *
* *
* * * * *

-----------------------------

Que 10 : Write a java program to print given pattern

*
* *
* * *
* * * *
* * * * *

-----------------------------

Que 11 : Write a java program to print given pattern

*
* *
* *
* *
* * * * *

-----------------------------

Que 12 : Write a java program to print given pattern

*
* *
* * *
* * * *
* * * * *

-----------------------------

Que 13 : Write a java program to print given pattern

*
* * *
* * * * *
* * * * * * *
* * * * * * * * *

You might also like