1) What is the first step in problem-solving? A) Writing code B) Debugging C) Understanding the problem D) Optimizing the solution Answer: C 2) Which of these is not a step in the problem-solving process? A) Algorithm development B) Problem analysis C) Random guessing D) Testing and debugging Answer: C 3) What is an algorithm? A) A high-level programming language B) A step-by-step procedure to solve a problem C) A flowchart D) A data structure Answer: B 4) Which of these is the simplest data structure for representing a sequence of elements? A) Dictionary B) List C) Set D) Tuple Answer: B 5) What does a flowchart represent? A) Errors in a program B) A graphical representation of an algorithm C) The final solution to a problem D) A set of Python modules Answer: B 6) What is pseudocode? A) Code written in Python B) Fake code written for fun C) An informal high-level description of an algorithm D) A tool for testing code Answer: C 7) Which of the following tools is NOT commonly used in pr...
1) What do you mean by platform independent in java?
Platform independence means that you can run the same java program in any Operating system. For example, you can write java program in window and run it in Mac OS.
2) What is JVM and is it platform independent ?
Java virtual machine (JVM) is the heart of java programming language. JVM is responsible for converting byte code into machine readable code. JVM is not platform independent, that's why you have different JVM for different operating system. We can customize JVM with java options, such as minimum and maximum memory to JVM. It is called virtual because it provides an interface that doesn't depend on the underlying OS.
3) Java compiler is stored in JDK, JRE or JVM ?
The task of java compiler is to convert java program into byte code, we have javac executeable for that. So it must be stored in JDK, we don't need it in JRE and JVM is just the specs.
4) Which class is the superclass of all the classes?
java.lang.Object is the root class for all the java classes and we don't need to extend it.
5) Why java is not Object Oriented Programming language?
Java is not a pure OOP language due to two reasons:
The first reason is that the object oriented programming language should only have objects whereas java contains 8 primitives data types like char, boolean, byte, short, int, long, float, double which are not objects. These primitive data types can be used without the use of any object.
The second reason related to the static keyword. In pure object oriented language, we should access everything by message passing(through objects). But java contains static variables and methods which can be accessed directly without using objects. That means, when we declare a class as 'static' then it can be referenced without the use of an object.