Fresher Java Interview Questions in Auromine Solutions – Part – II
This blog explains about Fresher Java Interview Questions in Auromine Solutions – Part – II . Some of them are discussed below :
We have already seen some questions in the previous blog and few more programs are shown below .
REFERENCES : Fresher Java Interview Questions in Auromine Solutions – Part – I
https://payilagam.com/blogs/fresher-java-interview-questions-in-auromine-solutions-part-i/
_____________________________________________________
1. What is String arg [] ?
String [] arguments is a java array of String objects. This means that the main function expects an array of Strings.
This array of strings typically holds all command line parameter arguments passed in when the program is run from the command line.
A Java String contains an immutable sequence of Unicode characters.
Unlike C/C++, where string is simply an array of char , A Java String is an object of the class java.lang . …
For example, the method to UpperCase() constructs and returns a new String instead of modifying the its existing content.
_________________________________________________
2. What is static ?
What’s the difference between a static variable and a class variable?
Both the static and class keywords allow us to attach variables to a class rather than to instances of a class.
For example, you might create a Student class with properties such as name and age, then create a static number Of Students property that is owned by the Student class itself rather than individual instances.
Where static and class differ is how they support inheritance:
When you make a static property it becomes owned by the class and cannot be changed by subclasses, whereas when you use class it may be overridden if needed
For example, here’s a Person class with one static property and one class property:
class Person { static var count: Int { return 250 } class var averageAge: Double { return 30 }}
_______________________________________________________________________________
3 . What is thread ?
A process with two threads of execution, running on one processor .
In computer science, a threadof execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system.[1] The implementation of threads and processes differs between operating systems, but in most cases a thread is a component of a process.
Multiple threads can exist within one process, executing concurrently and sharing resources such as memory, while different processes do not share these resources.
In particular, the threads of a process share its executable code and the values of its variables at any given time.
_______________________________________________________________________________