Java basic syntax(PartI)

1. In Java, A program starts with the main() method of a class?
a. True    b. False Check answer 22. The System.out.println() method is used to receive data from keyboard in a console program.
a. True   b. False
Check answer 3. The System.in.read() can be used to read a character from keyboard.
a. True   b. False Check answer 4. In Java, to read a string from keyboard, the BufferedReader class is used.
a. True    b. False Check answer 5. In Java, to read a numerical value from keyboard, the Scanner class is used.
a. True    b. False Check answer 6. A comment in Java language multi-line comment starts with /* and ends with */.
a. True b. False Check answer 7. In Java, which of the following is not a numerical type?
a.int    b.char    c. float    d.short   e.double Check answer 8. In Java language, which one is not the integer value?
a.12    b.'23'    c.10    d.100 Check answer 9. What is the type of each of the following constants?
a.10    b.'2'    c.10.7    d."12" Check answer 10. What is the type of each of the following constant?
a."Dara"    b.'2.9'    c."10.7"    d.13.9f    e.'\a' Check answer 11. Find any errors in the following Java program:

public static void main(String[] args){ /* This is the main method*/
    System.out.println("Hello")
   
}
Check answer

HTML Comment Box is loading comments...



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.