Prac Flashcards

1
Q

Super class of exception and error

A

Throwable Class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Graphics class belongs to which class

A

AWT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Awt full form

A

Abstract Window Toolkit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Import statement used for

A

import statement is used to access buit-in java packages which contains a set of particular classes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Int data type ka size

A

4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

New keyword ka use

A

New keyword is used in new operator to create a new object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Static and non static method me diff..and unko call kerne ka difference

A
Static methods are methods which do not have any relationship with objects in the class , they exist independently and the class may not have an object at all.
Any method that has a relationship with the object is called non-static method.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Inheritance kya hai

A

In Java, an object can acquire the behavior and properties from another object. This is also called a parent-child relationship. Morover, the child may even have behavior and properties of its own.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Array kaise declare kerna

A

Datatype [ ] name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Abstract method kya hai..and u ll know its abstract class

A

Abstract class is a class that cant be used to create objects. Abstarct method is a method which is not implemented.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Diff between string buffer and string class

A
String class is used to store data sequentially and it is immutable i.e. That once the memory is assigned it cant be diminished or changed.
String buffer however is also used to store data sequentially but is mutable i.e. the memory can be deleted or modified
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Enhance for loop

A

Enhanced for loop is a type of for loop that is used to iterate through a collection of data in first to last order and the user doesnt need to know the crent value of the index. It does so by traversing the data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

User defined data types in java

A

User defined data types are the data types that are created by the user in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Command line arguments

A

Command Line arguments are the arguments that are passed at the command line during the execution of a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Showinputdialog box kya return kerta hai

A

String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

than what is array fir

A

Array is used to store similar type of data in Java but has a limit to it. It is further o f 2 types :-
Single-dimensional array
Multi-dimensional Array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

super class of exception & error

A

Throwable Class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

graphics kiska part h?

A

Abstract window Toolkit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

haan applet kiska part h

A

Java.Applet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

difference print & println

A

Print() prints output isn the same line

Println() provides output in the next line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Console application

A

The console applicaton is used to get input from Console. It is used to read texts and passwords from the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Native method

A

A native method is a method in java whose implementation is written in a language other than java.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Applet

A

An applet is a special type of program that is embedded in a webpage to generate dynamic content. It works on the client side.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

AWT

A

Abstract Window Toolkit. It is a platform dependent API that is used to create GUI for Java progs.

25
Difference between length and length()
length is used to find out length of an array and does so directly length() is used to find out length of a string and it does so by invoking a method rather than doing it directly
26
Equals()
Equals() is used to compare two strings in Java and returns true if the values are the same, false otherwise.
27
Short Ka bytes
2
28
which is the parent class for all the wrapper class
Number for int,long,short and object for char and boolean
29
COncrete method
A method that is not abstarct is caleed concrete method i.e. method definition is provided in the same class as declaration.
30
Method overloading
A class in java may have multiple methods with the same name and return type,but with different number of arguments or datatype of arguments
31
Method Overriding
When A child class has the same method and parameters as Parent Class, it is called Method Overriding.
32
Array class belongs to which package
Java.util
33
Heart and soul of thread
Run()
34
Multiple inheritance is possible or not
no
35
1. array name contains what?
It contains the reference to the memory address where the value is stored
36
3. difference abstract class and interface?
Abstract class provides partial abstarction, uses extends, can have constructor, can inherit another class and implement an interface, Interface provides complete abstraction, uses implements, cant have constructors, and can only inherit another interface.
37
5. Instanceof operator?
The instanceof() operator is used to determine whethen object belongs to a particular class or not and returns true or false accordingly.
38
6. What does ShowConfirm dailog box returns?
int
39
7. What does ShowInput dailog box returns?
str
40
8. What does ShowMessage dailog box returns?
str
41
10. Why we use object of graphic class in paint method()?
Graphic class is an abstract class and paint () is a method which contains shapes lines etc but whose default version does nothing. So paint () is called to help draw lines, shapes etc.
42
11. printStackTrace()?
PRINTSTACKTRACE() helps us to trace the trail of a method which threw an exception by displaying a stack of called methods.
43
12. thread life cycle methods?
newborn, runnable, running, blocked, dead states.
44
applet lifecycle methods
born, running, idle , destroyed
45
14. diff setcolor setbackgroundcolor?
setcolor is used to set the color of a particular shape, while setbackgroundcolor is used to the bachgroundcolor of the applet.
46
21. CharAt?
Returns the character at specified index
47
22. Wrapper class belong to which package?
Java.lang
48
24. Method which set the background color in graphics?
setBackground COlor
49
25. Set font() method?
SETS THE FONT OF TEXT IN APPLET
50
27. protected class?
A class that is accessible inside the package and outside the package using child class
51
30. What is package?
A named collection of classes and interfaces
52
1. What is package?
javax.swing.joptionpane()
53
2. Default package imported in java?
Java.lang
54
5. Why we specify joptionpane in front of showinputdialog?
Joptionpane is the class name that allows us to produce the dialog box
55
8. What is filloval method?
It is used to draw an oval and fill it witha particular color
56
10. default constructor
When a class has no constructor, the compiler automatically creates a default constructor
57
isAlive() method?
This method tests whether the thred is alive
58
currentThread()
Returns reference to currently implementing thread object
59
7. Why we use runnable interface?
It should be used by any class whose instances are intended to be used by a thread.