Submitted by c-admin on Mon, 05/27/2019 - 22:37
What will be the output of the following program when it is compiled and run with the command line
java TestClass 1 2 3
public class TestClass {
public static void main(String[] args) {
System.out.println("Values : "+args[0]+args[1]);
}
}
Select 1 option
A. Values: java TestClass
B. Values: TestClass 1
C. Values: 12
D. Values: 23
E. Values: 3
Submitted by c-admin on Mon, 05/27/2019 - 22:27
Which of the following are valid declarations of the standard main() method?
Select 2 options
A. static void main(String args[ ]) { }
B. public static int main(String args[ ]) {}
C. public static void main (String args) { }
D. final static public void main (String[ ] arguments ) { }
E. public static void main (String[ ] args) { }
Submitted by c-admin on Mon, 05/27/2019 - 22:23
Which method declarations will enable a class to be run as a standalone program?
Select 2 options
A. static void main(String args[ ])
B. public void static main(String args[ ])
C. public static main(String[ ] argv)
D. final public static void main(String [ ] array)
E. public static void main(String args[ ])
Submitted by c-admin on Mon, 05/27/2019 - 22:21
Given the following class, which of these are valid ways of referring to the class from outside of the package com.enthu?
package com.enthu;
public class Base{
// ....
// lot of code...
}
Select 2 options
A. Base
B. By importing the package com.* and referring to the class as enthu.Base
C. importing com.* is illegal.
D. By importing com.enthu.* and referring to the class as Base.
E. By referring to the class as com.enthu.Base.
Submitted by c-admin on Mon, 05/27/2019 - 22:16
Which of the following are valid identifiers?
Select 2 options
A. class
B. $value$
C. angstrom
D. 2much
E. zer@
Pages