From 744056915d3611296dbb2a475dcb801f430edb28 Mon Sep 17 00:00:00 2001 From: prathamesh7ai <57220446+prathamesh7ai@users.noreply.github.com> Date: Thu, 31 Oct 2019 19:18:00 +0530 Subject: [PATCH] java-tricky-questions --- CONTRIBUTING.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b42b468..4e7af98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,29 @@ -You can contribute any programs whic can worthy +//You can contribute any programs whic can worthy +//Till now, we were always taught “Comments do not Execute”. Let us see today “The comments that execute” + +public class Testing { + public static void main(String[] args) + { + // the line below this gives an output + // \u000d System.out.println("comment executed"); + } +} + + + +public class Demo{ + public static void main(String[] arr){ + + } + public static void main(String arr){ + + } +} + +/*Choices: + +a) Nothing +b) Error +Answer: a) Nothing +Reason: We can overload main() too. But JVM will always call main() that has String[] argument. +*/