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
Q

Difference between length and length()

A

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
Q

Equals()

A

Equals() is used to compare two strings in Java and returns true if the values are the same, false otherwise.

27
Q

Short Ka bytes

A

2

28
Q

which is the parent class for all the wrapper class

A

Number for int,long,short and object for char and boolean

29
Q

COncrete method

A

A method that is not abstarct is caleed concrete method i.e. method definition is provided in the same class as declaration.

30
Q

Method overloading

A

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
Q

Method Overriding

A

When A child class has the same method and parameters as Parent Class, it is called Method Overriding.

32
Q

Array class belongs to which package

A

Java.util

33
Q

Heart and soul of thread

A

Run()

34
Q

Multiple inheritance is possible or not

A

no

35
Q
  1. array name contains what?
A

It contains the reference to the memory address where the value is stored

36
Q
  1. difference abstract class and interface?
A

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
Q
  1. Instanceof operator?
A

The instanceof() operator is used to determine whethen object belongs to a particular class or not and returns true or false accordingly.

38
Q
  1. What does ShowConfirm dailog box returns?
A

int

39
Q
  1. What does ShowInput dailog box returns?
A

str

40
Q
  1. What does ShowMessage dailog box returns?
A

str

41
Q
  1. Why we use object of graphic class in paint method()?
A

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
Q
  1. printStackTrace()?
A

PRINTSTACKTRACE() helps us to trace the trail of a method which threw an exception by displaying a stack of called methods.

43
Q
  1. thread life cycle methods?
A

newborn, runnable, running, blocked, dead states.

44
Q

applet lifecycle methods

A

born, running, idle , destroyed

45
Q
  1. diff setcolor setbackgroundcolor?
A

setcolor is used to set the color of a particular shape, while setbackgroundcolor is used to the bachgroundcolor of the applet.

46
Q
  1. CharAt?
A

Returns the character at specified index

47
Q
  1. Wrapper class belong to which package?
A

Java.lang

48
Q
  1. Method which set the background color in graphics?
A

setBackground COlor

49
Q
  1. Set font() method?
A

SETS THE FONT OF TEXT IN APPLET

50
Q
  1. protected class?
A

A class that is accessible inside the package and outside the package using child class

51
Q
  1. What is package?
A

A named collection of classes and interfaces

52
Q
  1. What is package?
A

javax.swing.joptionpane()

53
Q
  1. Default package imported in java?
A

Java.lang

54
Q
  1. Why we specify joptionpane in front of showinputdialog?
A

Joptionpane is the class name that allows us to produce the dialog box

55
Q
  1. What is filloval method?
A

It is used to draw an oval and fill it witha particular color

56
Q
  1. default constructor
A

When a class has no constructor, the compiler automatically creates a default constructor

57
Q

isAlive() method?

A

This method tests whether the thred is alive

58
Q

currentThread()

A

Returns reference to currently implementing thread object

59
Q
  1. Why we use runnable interface?
A

It should be used by any class whose instances are intended to be used by a thread.