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

Java Viva Questions & Answers Guide

The document contains a series of Java viva questions and answers covering fundamental concepts of the Java programming language. Key topics include the development of Java, its object-oriented nature, data types, inheritance, exception handling, and threading. It also addresses Java's platform independence, file extensions, and the structure of a Java program.

Uploaded by

Thor Odin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Java Viva Questions & Answers Guide

The document contains a series of Java viva questions and answers covering fundamental concepts of the Java programming language. Key topics include the development of Java, its object-oriented nature, data types, inheritance, exception handling, and threading. It also addresses Java's platform independence, file extensions, and the structure of a Java program.

Uploaded by

Thor Odin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JAVA VIVA QUESTIONS AND ANSWERS (SHORT)

Q: Who developed Java?


A: James Gosling

Q: In which year was Java developed?


A: 1995

Q: Which company originally developed Java?


A: Sun Microsystems

Q: What is Java?
A: Object-oriented programming language

Q: Java is platform-________.
A: Independent

Q: File extension of Java source code?


A: .java

Q: File extension after compilation?


A: .class

Q: Which compiler is used in Java?


A: javac

Q: Java code is compiled into?


A: Bytecode

Q: Bytecode runs on?


A: JVM (Java Virtual Machine)

Q: Name four pillars of OOP.


A: Encapsulation, Inheritance, Polymorphism, Abstraction

Q: What is a class?
A: Blueprint of an object

Q: What is an object?
A: Instance of a class

Q: What is inheritance?
A: Acquiring properties of another class

Q: Keyword for inheritance?


A: extends

Q: Keyword for interface implementation?


A: implements

Q: Keyword to stop inheritance?


A: final

Q: How many primitive data types in Java?


A: 8

Q: Smallest data type?


A: byte

Q: Largest integer type?


A: long

Q: Decimal types?
A: float, double

Q: Character type?
A: char

Q: Boolean values?
A: true / false

Q: Loop executes at least once?


A: do-while

Q: Jump statement to exit loop?


A: break

Q: String in Java is a _______.


A: Class

Q: Strings are mutable or immutable?


A: Immutable

Q: Constructor name is same as?


A: Class name

Q: Constructor return type?


A: None

Q: Keyword to handle exception?


A: try-catch

Q: Keyword always executed?


A: finally

Q: Keyword to raise exception manually?


A: throw

Q: Thread represents?
A: Independent path of execution

Q: Two ways to create thread?


A: Extending Thread / Implementing Runnable
Q: Method to start thread?
A: start()

Q: What is a package?
A: Collection of classes

Q: Keyword to create package?


A: package

Q: What is an interface?
A: Collection of abstract methods

Q: Java supports multiple inheritance?


A: No (via classes), Yes (via interfaces)

Q: Default access modifier?


A: default

Q: Java supports operator overloading?


A: No

Q: Java supports pointers?


A: No

Q: Garbage collection done by?


A: JVM

Q: Method for garbage collection?


A: finalize()

Q: Entry point of Java program?


A: main() method

Q: Syntax of main method?


A: public static void main(String[] args)

Q: Package containing System class?


A: [Link]

You might also like