gs gs111 Types of Classes (Using Java) - Final Class - Quiz No.1
gs gs111 OOP Object Oriented Programming Java Quiz
This quiz belongs to book/course code gs gs111 OOP Object Oriented Programming Java of gs organization. We have 178 quizzes available related to the book/course OOP Object Oriented Programming Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Types of Classes (Using Java). NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
final class Final { static String s = "NVAEducation"; } public class Program extends Final { public static void main(String[] args) { System.out.println(s); } }
final class Final extends Program { public void Print() { System.out.println(s); } } class Program { String s = "NVAEducation"; } public class FinalCall { public static void main(String[] args) { Final f = new Final(); f.Print(); } }
static final class Program { public void display(char ch) { System.out.println("The ascii value of "+ch+" is "+(int)ch); } } public class FinalExe { public static void main(String[] args) { Program.display('c'); } }
public class Outer { class Program { String s = "NVAEducation"; } final class Final extends Program { void print() { for(int i=0;i<s.length();i++) { if(i%2==0) System.out.print(s.charAt(i)); } } } public static void main(String[] args) { Outer i = new Outer(); Outer.Final j = i.new Final(); j.print(); } }
public class StaticFinalClass { static final class Final { Integer i = new Integer(6124); void ClassCheck() { System.out.println(i.getClass()); System.out.println(i.getClass().getSuperclass()); } } public static void main(String[] args) { StaticFinalClass.Final i = new StaticFinalClass.Final(); i.ClassCheck(); } }
class java.io.Integer class java.io.Object
class java.io.Integer class java.io.Number
class java.lang.Integer class java.lang.Number
final class Program { public void Loop() { for(int i=1;i>0;i++); { System.out.println(i); } } } public class LoopClass { public static void main (String[] args) { Program i = new Program(); i.Loop(); } }
1 0
0 1
public final class Check { public static void main (String[] args) { for(short i=32767;i>0;i++) { System.out.println(i); } } }
32767 32768 32769 32700
public final class Inheritance { class Program { String s = "Class Program"; } class Print extends Program { void display() { System.out.println(s); } } public static void main (String[] args) { Inheritance i = new Inheritance(); Inheritance.B j = i.new B(); j.display(); } }