




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A comprehensive set of java interview questions and answers tailored for freshers. It covers fundamental concepts such as platform independence, key java features, jvm, jit, memory storages, classloaders, and differences between java and c++. Additionally, it explains the components of the main method, java string pool, packages, and data types, offering valuable insights for beginners preparing for java interviews. This resource is designed to help new developers understand core java principles and enhance their interview readiness, making it an excellent study aid for those entering the field of java programming.
Typology: Quizzes
1 / 152
This page cannot be seen from the preview
Don't miss anything!





























































































// Java Program to demonstrate use of default values import java.io.; class GFG {* // static values static byte b; static int i; static long l; static short s; static boolean bool; static char c; static String str; static Object object; static float f; static double d; static int[] Arr; public static void main(String[] args) { // byte value System.out.println("byte value" + b); // short value System.out.println("short value" + s); // int value System.out.println("int value" + i); // long value System.out.println("long value" + l); System.out.println("boolean value" + bool); System.out.println("char value" + c); System.out.println("float value" + f); System.out.println("double value" + d); System.out.println("string value" + str); System.out.println("object value" + object); System.out.println("Array value" + Arr); } }
+ GFG.ctr); } }
// Java Program to demonstrate Instance Variable import java.io.; class GFG { private String name; public void setName(String name) { this.name = name; } public String getName() { return name; } public static void main(String[] args) { GFG obj = new GFG(); obj.setName("John"); System.out.println("Name " + obj.getName()); }*
// Java Program to demonstrate Class Variable import java.io.; class GFG {* // class variable **private static final double PI = 3.14159; private double radius; public GFG(double radius) { this.radius = radius; } public double getArea() { return PI * radius * radius; } public static void main(String[] args) { GFG obj = new GFG(5.0); System.out.println("Area of circle: "