Evaluate Your Knowledge Of Core Java

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Bmondal
B
Bmondal
Community Contributor
Quizzes Created: 2 | Total Attempts: 1,266
| Attempts: 322 | Questions: 5
Please wait...
Question 1 / 5
0 %
0/100
Score 0/100
1. Which is the correct way to declare and store a character value to a variable?

Explanation

The correct way to declare and store a character value to a variable is by using the syntax "char ch='A'". In this case, the variable "ch" is declared as a character type and assigned the value 'A'.

Submit
Please wait...
About This Quiz
Evaluate Your Knowledge Of Core Java - Quiz

This quiz evaluates your understanding of Core Java, focusing on syntax, programming structures, and key concepts such as static methods and abstract classes. Ideal for learners seeking to... see moretest their Java programming skills and deepen their knowledge. see less

2. Which of following is the correct declaration of main method?

Explanation

The correct declaration of the main method is "static public void main(String []a)". In Java, the main method is the entry point of a program and it must be declared as public, static, and void. The "public" keyword allows the method to be accessed from outside the class, the "static" keyword allows the method to be called without creating an instance of the class, and the "void" keyword indicates that the method does not return any value. The main method also takes a parameter of type String array, which allows command-line arguments to be passed to the program.

Submit
3. Predict the output. abstract class cal {"\n" abstract public void sum(); abstract public void mul(); } public class calculation extens cal { int a=10,b=20,res=0; public void sum() { res=a+b; System.out.println("Result is : " +res); } public static void main(String []a) { calculation c=new calculation(); c.sum(); } }

Explanation

Programe will generate compile time error.
calculation is not abstract and does not override abstract method "mul()"

Submit
4. How execute a java program? Programe file name is "Example.java".

Explanation

To execute a Java program with the file name "Example.java", the correct command is "java Example". This command runs the compiled bytecode file generated by the "javac" command. The "javac" command is used to compile the Java source code file into bytecode. Therefore, options "javac Example" and "javac Example.java" are incorrect as they are used for compilation, not execution. The correct command to execute the program is "java Example".

Submit
5. While key words allow us to use class variable with our declaring the object of the class?

Explanation

The correct answer is "static". The keyword "static" allows us to use class variables without declaring an object of the class. Static variables are shared among all instances of a class and can be accessed directly using the class name.

Submit
View My Results

Quiz Review Timeline (Updated): Oct 4, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Oct 04, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 21, 2012
    Quiz Created by
    Bmondal
Cancel
  • All
    All (5)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which is the correct way to declare and store a character value...
Which of following is the correct declaration of main method?
Predict the output....
How execute a java program? Programe file name is...
While key words allow us to use class variable with our declaring the...
Alert!

Advertisement