JAVA ONE LINER PART 08
1) What are identifiers and what is naming convention?
Ans : Identifiers are used for class names, method names and variable names. An identifier may be any descriptive sequence of upper case & lower case letters,numbers or underscore or dollar sign and must not begin with numbers.
2) What is the return type of program’s main( ) method?
Ans : void
3) What is the argument type of program’s main( ) method?
Ans : string array.
4) Which characters are as first characters of an identifier?
Ans : A – Z, a – z, _ ,$
5) What are different comments?
Ans : 1) // -- single line comment
2) /* -- */ multiple line comment
3) /** -- */ documentation
6) What is the difference between constructor method and method?
Ans : Constructor will be automatically invoked when an object is created. Whereas method has to be call explicitly.
7) What is the use of bin and lib in JDK?
Ans : Bin contains all tools such as javac, applet viewer, awt tool etc., whereas Lib contains all packages and variables.
Ans : Identifiers are used for class names, method names and variable names. An identifier may be any descriptive sequence of upper case & lower case letters,numbers or underscore or dollar sign and must not begin with numbers.
2) What is the return type of program’s main( ) method?
Ans : void
3) What is the argument type of program’s main( ) method?
Ans : string array.
4) Which characters are as first characters of an identifier?
Ans : A – Z, a – z, _ ,$
5) What are different comments?
Ans : 1) // -- single line comment
2) /* -- */ multiple line comment
3) /** -- */ documentation
6) What is the difference between constructor method and method?
Ans : Constructor will be automatically invoked when an object is created. Whereas method has to be call explicitly.
7) What is the use of bin and lib in JDK?
Ans : Bin contains all tools such as javac, applet viewer, awt tool etc., whereas Lib contains all packages and variables.
No comments:
Post a Comment