Software Dev Exam 2016 Flashcards
What is the size of a byte variable?
8 bits
What is the default value of a byte variable?
0
Which is true about the private access modifier?
Variables, methods and constructors which are declared private can only be accessed by the members of the same class.
What is an instance variable?
Instance variables are variables within a class but outside any method.
Which arithmetic operations can result in the throwing of an arithmetic exception?
/ & %
Which of the following is not a keyword in Java?
Seal
Which of the following is true about the public access modifier?
Variables, methods and constructors which are declared public can be accessed by any class lying in the same package.
What is the size of the char variable?
16 bits
Which method must be implemented by all threads?
Run()
What is the default value of short variable?
0
What is a class in Java?
A class is a blueprint from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
What is a class variable?
Class variables are variables declared within a class, outside any method, with the static keyword.
What is encapsulation?
It is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. Therefore encapsulation is also referred to as data hiding.
What is an instance variable?
They are variables within a class but outside any method. These variables are instantiated when the class is loaded.
What is an applet?
An applet is a small internet based Java program that runs in a web browser.