Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Private Access Modifier Error when we call it

// Java program to illustrate error while
 using class from different package with
 private modifier
package one;

class A
{
private void display()
	{
		System.out.println("Welcome to softhunt.net");
	}
}

class B
{
public static void main(String args[])
	{
		A obj = new A();
		// Trying to access private method
 of another class
		obj.display();
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: itext new page 
Java :: spring service discovery 
Java :: set skin minecraft entity player 
Java :: how does java knows where it has stored primitive data type 
Java :: Java program pattern program to triangle using 100 numbers 
Java :: Add items to ArrayList Using add() function 
Java :: java list sort comparator date descending lambda 
Java :: exit for loop java stack overflow 
Java :: java set get all not containing 
Java :: nsxt resource relationships in java 
Java :: Java Floating-point Literals 
Java :: switch expression 
Java :: java unshift 
Java :: masquer saisie mot de passe java console 
Java :: bluetooth chat example android server 
Java :: print string in reverse order using recursion java 
Java :: witch dependency is needed for "ArraysUtils" for the Import? 
Java :: serilize filke in java 
Java :: java inetaddress workaround how to get localhost secure 
Java :: Java Copying Arrays Using Assignment Operator 
Java :: how to check android version 9 above programatically 
Java :: error attribute fabattached not found 
Java :: ChangeElementsOfHashMap 
Java :: apache poi excel color 
Java :: trivers json node as node type2 
Java :: kotless scheduled event 
Java :: run java in cmd 
Java :: query spring boot 
Java :: rotate matrix in java 
Java :: Calculate weeks from date using java 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =