Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

Core java Interview Question

Rating
-
Sold
-
Pages
27
Uploaded on
24-03-2023
Written in
2022/2023

The Core Java Interview Type Question Are Surely Easy To Attend The Any Placement Java Related Basic questions...

Institution
Course

Content preview

Basic Java Interview Question


Q1) Is the Java platform independent?

Yes. Java is a platform-independent language. We can write java code on one platform and run it

on another platform. For e.g. we can write and compile the code on windows and can run the

generated bytecode on Linux or any other supported platform. This is one of the main features of

java.



Q2) What all memory areas are allocated by JVM?

Classloader, Class area, Heap, Stack, Program Counter Register, and Native Method Stack



Q3) Java vs. C ++?

Here are the few differences between Java and C++:

Platform dependency – C++ is platform dependent while java is platform-independent

No goto support – Java doesn’t support the goto statement while C++ does.

Multiple inheritances – C++ supports multiple inheritances while java does not.

Multithreading – C++ does not have in-build thread support, on the other hand, java supports

multithreading

Virtual keyword – C++ has the virtual keyword, it determines if a member function of a class

can be overridden in its child class. In Java, there is no concept of the virtual keyword.



Q4) Explain public static void main(String args[])

Here the public is an access modifier, which means that this method is accessible by any class.

,Static – static keyword tells that this method can be accessed without creating the instance of the

class. Refer: Static keyword in java

Void – this main method returns no value.

Main – It is the name of the method.

String args[] – The args is an array of String types. This contains the command-line arguments

that we can pass while running the program.



Q5) What is Javac?

The javac is a compiler that compiles the source code of your program and generates bytecode.

In simple words, javac produces the java byte code from the source code written *.java file. JVM

executes the bytecode to run the program.



Q6) What is the class?

A class is a blueprint or template or prototype from which you can create the object of that class.

A class has a set of properties and methods that are common to its objects.



Q7) What is the base class of all classes?

Java.lang.Object is the base class (superclass) of all classes in java.



Q8) What is a wrapper class in Java?

A wrapper class converts the primitive data type such as int, byte, char, boolean, etc. to the

objects of their respective classes such as Integer, Byte, Character, Boolean, etc.

, Q9) What is a path and classPath in Java?

Path specifies the location of .exe files. Classpath specifies the location of bytecode (.class files).



Q10) Different Data types in Java.

Byte – 8 bit

Short – 16 bit

Char – 16 bit Unicode

Int – 32 bit (whole number)

Float – 32 bit (real number)

Long – 64 bit (Single precision)

Double – 64 bit (double precision)



Q11) What is Unicode?

Java uses Unicode to represent the characters. Unicode defines a fully international character set

that can represent all of the characters found in human languages.



Q12) What are Literals?

Any constant value that is assigned to a variable is called literal in Java. For example –

// Here 101 is a literal

Int num = 101



Q13) Dynamic Initialization?

Written for

Course

Document information

Uploaded on
March 24, 2023
Number of pages
27
Written in
2022/2023
Type
OTHER
Person
Unknown

Subjects

$9.69
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
sarmisarmiladevi

Get to know the seller

Seller avatar
sarmisarmiladevi GHSS.VEERAPANDI
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions