Telegram Web Link
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
Java Access Spacifier
--------------------------------------
1) Private :- members [method and variable] are only used in same class.
2) default :- if you not write any access specifier then it is consider default. Default members are accessible only with in same package
3) protected :- veritable, methods, and contractor, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class with in the package of the protected members class
4) public :- A class, method, contractor, interface, etc. declared public can be accessed from any other class. Therefore fields, methods, blocks declared in side a public class can be accessed from any class belonging to java Universe.
Join us @Compu
πŸ‘9πŸ”₯1
πŸ‘7
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
Java
Why to use import?
To use classes of other packages
@Compu
✍🏻✍🏻...... πŸƒπŸƒπŸƒ..... ✍🏻✍🏻
Q:- What is class?
Ans:- Collection of variable and methods.

Q:- Why to create object?
Ans:- to call members of some other class.
Q:- why to write method?
Ans:- To perform any
Q:- why to use veriable?
Ans:- To store a data.

@Compu
πŸ‘12
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
Q :- What is Constructor? (In JAVA)
Answer: A constructor is a special method whose task is to initialize the object of its class.
It is special because its name is the same as the class name.
They do not have return types, not even void and therefore they cannot return values.
They cannot be inherited, though a derived class can call the base class constructor.
Constructor is invoked whenever an object of its associated class is created.

@Compu
πŸ‘8
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
IN JAVA
> Importing all classes on lang package.
>> In java every class is subclass of object class [in java Object is inbuilt class]
>>> In every constructor at first line automatically super() will be added.
@Compu
πŸ‘8
Q:- Find the output of the following code.

int ++a = 100; System.out.println(++a);
Anonymous Quiz
26%
101
49%
Compile error as ++a is not valid identifier
22%
100
3%
None
πŸ‘11πŸ”₯2πŸ‘2
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
Q:- Find the output of the following code.
Public class Solution{ Public static void main(String… argos){ Int x = 5; X * = 3 + 7; System.out.println(x);
Anonymous Quiz
27%
50
33%
22
27%
10
12%
None
πŸ‘13πŸ₯°3
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
Q. Identify the return type of a method that does not return any value.
Anonymous Quiz
17%
Int
53%
void
23%
double
6%
None
πŸ‘13πŸ‘3
πŸ‘14
πŸ‘14
πŸ‘9❀1
πŸ‘10
πŸ‘6
πŸ‘10
πŸ‘39πŸ₯°5
πŸ‘28
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
In JAVA
>Serialization : writing of object state into any external source [file, cloud] is called as serialization.

>DeSeralization : reading of data from external source [file, cloud] and converting that into object is called as deserailization.

>This concept is used in sending data in distributed system.

@Compu
πŸ‘21
✍🏻✍🏻......πŸƒπŸƒπŸƒ......✍🏻✍🏻
Q: Where does the system stores parameters and local variables whenever a method is invoked?
Anonymous Quiz
15%
Heap
42%
Stack
36%
Array
7%
Tree
πŸ‘33πŸŽ‰7😁4πŸ₯°1🀯1
2025/07/08 19:26:55
Back to Top
HTML Embed Code: