-
-
-
-
-
-
-
Classes can implement methods and contain variables that are not constants
Skill/Topic: AWT & AppletsA) TrueB) False
-
________ is the keyword used to inherit a class
Skill/Topic: AWT & AppletsA) extends
-
-
-
-
-
-
Access specifiers: "public", "protected", "private", nothing?
Public – any other class from any package can instantiate and execute the classes and methodsProtected – only subclasses and classes inside of the package can access the classes and methodsPrivate – the original class is the only class allowed to execute the methods
-
-
-
In Java, You can create a String object as: String str = "abc"; & String str = new String("abc");Why cant a button object be created as : Button bt = "abc" Why is it compulsory to create a button object as: Button bt = new Button("abc"); Why is this not compulsory in String's case?
The main reason you cannot create a button by Button bt1= "abc"; is because "abc" is a literal string (something slightly different than a String object, bytheway)and bt1 is a Button object. That simple. The only object in Java that can be assigned a literal String is java.lang.String. Important to note that you are NOT calling a java.lang.String constuctor when you type String s = "abc";For example String...
-
-
-
Java Interview Questions
Ans